Skip to content

Instantly share code, notes, and snippets.

@pedrofurla
Created January 2, 2014 16:44
Show Gist options
  • Select an option

  • Save pedrofurla/8222095 to your computer and use it in GitHub Desktop.

Select an option

Save pedrofurla/8222095 to your computer and use it in GitHub Desktop.
Nicta course types summary
data Id a
runId :: Id a -> a
mapId :: (a -> b) -> Id a -> Id b
bindId :: (a -> Id b) -> Id a -> Id b
data List t = Nil | t :. (List t)
infinity :: List Integer
foldRight :: (a -> b -> b) -> b -> List a -> b
foldLeft :: (b -> a -> b) -> b -> List a -> b
headOr :: a -> List a -> a
product :: List Int -> Int
sum :: List Int -> Int
length :: List a -> Int
map :: (a -> b) -> List a -> List b
filter :: (a -> Bool) -> List a -> List a
(++) :: List a -> List a -> List a
flatten :: List (List a) -> List a
flatMap :: (a -> List b) -> List a -> List b
seqOptional :: List (Optional a) -> Optional (List a)
find :: (a -> Bool) -> List a -> Optional a
lengthGT4 :: List a -> Bool
reverse :: List a -> List a
...
class Functor f where
(<$>) :: (a -> b) -> f a -> f b
(<$) :: Functor f => a -> f b -> f a
class Functor f => Apply f where
(<*>) :: f (a -> b) -> f a -> f b
lift2 :: Apply f => (a -> b -> c) -> f a -> f b -> f c
(*>) :: Apply f => f a -> f b -> f b
(<*) :: Apply f => f b -> f a -> f b
class Apply f => Applicative f where
pure :: a -> f a
sequence :: Applicative f => List (f a) -> f (List a)
replicateA :: Applicative f => Int -> f a -> f (List a)
filtering :: Applicative f => (a -> f Bool) -> List a -> f (List a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment