Better HN
topnewbestaskshowjobs
Log inSign up

mikeplus48

19 karma · joined Mar 24, 2012 (14y ago) · 8 submissions

my website: http://quasimal.com
Submissions

comment 13y ago · link · parent

Start with the spelling. :)

  data GADT a where
       Constructor0 :: Field a -> Field b -> GADT (a, b)
       Constructor1 :: ...
       ...

comment 13y ago · link · parent

There's luakit, uzbl, surf and jumanji from the top of my head, but I don't think any of these have "full interoperability with the CLI". luakit is definitely my favourite as it has been much more reliable than uzbl and easier to configure/extend (in lua).

comment 14y ago · link · parent

No, ghc produces statically linked binaries by default (-dynamic if you don't like that).

comment 14y ago · link · parent

You don't have to syntactically consume all of arguments of a function to write its body.

    f :: a -> Int -> Int -> Int
    f x = (+)
There really isn't anything meaningful to do with a function before it has consumed all it's arguments other than returning another function.

> However, this "f" is quite different from a function that has the signature "x->(y->z)"

Yes, we have applied the argument of type 'x'. f 0 is no longer of type "x -> y -> z", or "x -> (y -> z)" (because of -> precedence, the two are equivalent), it is "y -> z".

Currying is explicit.

    f x y = foobar
is just short hand for

    f = \x -> \y -> foobar

comment 14y ago · link · parent

I don't understand this point. If you have arguments x and y that you want to apply to this function, I don't see the problem in "using them directly".

Function application in Haskell is first class. If you have

    f :: x -> y -> z
    f x y = undefined
then use it like

    (f 0)
you have a new function:

    f 0 :: y -> z
then if you apply again,

    (f 0) 1
and this final expression, equivalent to f 0 1, gives you something of type 'z'

comment 14y ago · link · parent

This gives me an idea for a scanf-like QuasiQuoter...

comment 14y ago · link · parent

I'm the author of this post, it was a joke. I said "For those who have no idea what they're doing 90% of the time when they are in bash" very sarcastically, but obviously this wasn't conveyed very well, sorry.

edit: I know the defense "it was a joke" is very overplayed, but really, somewhere in between the graphs with rainbows and explosions, this post was intended to be humourous. :)