#haskell - Sun 25 Mar 2007 between 10:27 and 10:31

NY Lost Funds



HeffalumpfromIntegral (-5) :: Word32
> fromIntegral (-5) :: Word32
lambdabot4294967291
ivanmlol
Saizan> let x = 5 :: Int in x + 1 :: Word32
lambdabotCouldn't match expected type `Word32' against inferred type `Int'
Heffalumpso be careful about passing in negative numbers
xerox> (ap (==) . (length .) . flip take) "hello" 3
lambdabotTrue
xerox> (ap (==) . (length .) . flip take) "hello" 10
lambdabotFalse
Heffalump@src ap
lambdabotap = liftM2 id
ivanmwell, since its only for my use, I could just assume it works ;-)
resiak> (ap (==) . (length .) . flip take) [1..] 3
lambdabotTrue
xerox^_^
ivanm> (ap (==) . (length .) . flip take) [1..2] 3
lambdabotFalse
resiakwhy is that better than \n -> not . null . drop (n-1) ?
QtPlatypus@type ap
yuesefa@help
lambdabotforall (m :: * -> *) a b. (Monad m) => m (a -> b) -> m a -> m b
help <command>. Ask for help for <command>. Try 'list' for all commands
ivanm> (ap (==) . (length .) . flip take) [1..3] -1
lambdabotadd an instance declaration for (Num (Int -> Bool))
In the expression:
...
ivanmlol
xeroxresiak: nice one
ivanm> \n -> not . null . drop (n - 1) [1..] $ 3
lambdabotCouldn't match expected type `a -> [a1]'
yuesefaq
ivanm> \n -> not . null . drop (n - 1) $ [1..] $ 3
lambdabotCouldn't match expected type `a -> b' against inferred type `[a1]'
resiakivanm: I have the arguments the other way around
ivanmresiak: ahhh, k
resiak> let atLeast n = not . null . drop (n - 1) in atLeast 5 [1..5]
lambdabotTrue
ivanm> \n -> not . null . drop (n - 1) $ 3 $ [1..]

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 

IrcArchive

NY Lost Funds