Skip to main content

Posts

Showing posts from February, 2013

Angular.JS ... absolutely awesome BUT...

Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaagh! Sort the documentation soon please!  More soon, I really do like it though. :)

Curried Functions, my favourite!

I have understood the concept of "currying" for quite some time now but it wasn't until last night that I really understood how useful it (currying) can be when you want to use a standard library function but pass it something slightly different... I was playing with reading a file using the "withFile" function, withFile :: FilePath -> IOMode -> (Handle -> IO r) -> IO r Thing is, the function I wanted to write, as part of its duties, needed to print the filename to the console output before doing its thing... I knew that it could be done and for once I was going to think it through and make it happen! My function had the same type, (Handle -> IO r) , but now I wanted to add in the String that would be the filename and the penny dropped... by using partial application I could "part-bake" a call to my function and leave it in such a state that it would "fit" the required type... read on... got: Handle -> IO r

Haskell, GHC and --hash-size=31

A few nights back I decided to return to an on-going self-education project in Haskell and much to my dismay, when I issued the "ghc --make ..." utterance it failed to complete and instead gave me the error: $ ghc --make hwtest.hs Linking hwtest ... /usr/bin/ld: --hash-size=31: unknown option usr/bin/ld: use the --help option for usage information collect2: error: ld returned 1 exit status WTF? When did my linker system or GHC break when I wasn't looking? After two unsuccessful postings to the Haskell beginners newsgroup (unsuccessful as in they appeared not to have made it through the inter-web) I gave up and dug a little harder and turned up this post on the web: http://www.haskell.org/pipermail/cvs-ghc/2011-November/068562.html Bingo. I remedied the situation by performing this from the command line: sudo apt-get remove binutils-gold I didn't even know I had this package but then I suddenly remembered that a few nights previous and had foun