| lambdabot | Foreign.Marshal.Error.throwIf :: (a -> Bool) -> (a -> String) -> IO a -> IO a |
| jaredj | wkh, that's a good one. unlike this fix flippy flip thing. |
| araujo | QtPlatypus, you can make more concise code |
| slowriot | ... get it? hyuk hyuk hyuk |
| fax | > let pacman n x y = if n<0 then x else pacman n-1 x+y |
| lambdabot | Parse error |
| fax | :( |
| LoganCapaldo | @type let if' a b c = case a of { True -> b ; False -> c } in (fix (flip flip 1 . liftM2 if' (> 0) . ap (*) . (. subtract 1))) |
| lambdabot | forall c. (Ord c, Num c) => c -> c |
| fax | > let pacman n x y = if n<0 then x else (pacman (n-1) (x+y)) |
| lambdabot | Parse error |
| fax | can I do this? |
| jcreigh | QtPlatypus: but it's nice to be able to say, eg, filter (not . isDigit) xs without having to say "filter (\x -> not (isDigit x)) xs" (small example, I know) |
| chessguy | fax apparently not |
| fax | LOL can it be done? |
| wkh | fax: you're calling a 3-parameter function with 2 parameters |
| fax | wkh: I want to curry |
| QtPlatypus | > 143.00 / 1.1 |
| lambdabot | 130.0 |
| dolio | You're missing the "in" portion of the let expression. |
| mwc | fax, it can be done, but lambdabot want's in's as part of its toplevel |
| rahikkala | QtPlatypus: Also, along with fix, you can use it to produce amusingly powerful Haskell golf oneliners |
| mwc | > let foo = 5 |
| lambdabot | Parse error |
| mwc | >let foo = 5 in foo |
| chessguy | fax, you can't return two different types in two different cases |
| fax | what do I need for in > let pacman n x y = if n<0 then x else (pacman) (n-1) (x+y) in pacman 3 1 2 3 |
| wkh | you just type let <decl> in <expr> |
| lambdabot | Occurs check: cannot construct the infinite type: t = t1 -> t Probab... |
| chessguy | fax, you're returning x in one case, and a function in another |
| fax | yes thats why I use Either |
| allbery_b | an invcation of pacman, presumably, since you defined it presumably with intent to use it |
| fax | pacman :: Either (a -> b) Int |
| LoganCapaldo | you have to actually use either :) |
| jaredj | fax: let pacman n x y = if n<0 then Left x else Right $ (pacman) (n-1) (x+y) think i got the $ right |
| fax | :S |