Craft3e-0.2.0.1: Code for Haskell: the Craft of Functional Programming, 3rd ed.
Safe HaskellNone
LanguageHaskell2010

Chapter18

Synopsis

Documentation

helloWorld :: IO () Source #

^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^^

sumInteract :: IO () Source #

^^^^^^^^^^

randInt :: Integer -> Integer Source #

^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^^^

addOneInt' :: IO () Source #

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

^^^^^^^^^^^^^^^^^^^^^^

type Table a = [a] Source #

data State a b Source #

Constructors

State (Table a -> (Table a, b)) 

Instances

Instances details
Applicative (State a) Source # 
Instance details

Defined in Chapter18

Methods

pure :: a0 -> State a a0 #

(<*>) :: State a (a0 -> b) -> State a a0 -> State a b #

liftA2 :: (a0 -> b -> c) -> State a a0 -> State a b -> State a c #

(*>) :: State a a0 -> State a b -> State a b #

(<*) :: State a a0 -> State a b -> State a a0 #

Functor (State a) Source #

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Instance details

Defined in Chapter18

Methods

fmap :: (a0 -> b) -> State a a0 -> State a b #

(<$) :: a0 -> State a b -> State a a0 #

Monad (State a) Source # 
Instance details

Defined in Chapter18

Methods

(>>=) :: State a a0 -> (a0 -> State a b) -> State a b #

(>>) :: State a a0 -> State a b -> State a b #

return :: a0 -> State a a0 #

data Tree a Source #

Constructors

Nil 
Node a (Tree a) (Tree a) 

Instances

Instances details
Show a => Show (Tree a) Source # 
Instance details

Defined in Chapter18

Methods

showsPrec :: Int -> Tree a -> ShowS #

show :: Tree a -> String #

showList :: [Tree a] -> ShowS #

Eq a => Eq (Tree a) Source # 
Instance details

Defined in Chapter18

Methods

(==) :: Tree a -> Tree a -> Bool #

(/=) :: Tree a -> Tree a -> Bool #

Ord a => Ord (Tree a) Source # 
Instance details

Defined in Chapter18

Methods

compare :: Tree a -> Tree a -> Ordering #

(<) :: Tree a -> Tree a -> Bool #

(<=) :: Tree a -> Tree a -> Bool #

(>) :: Tree a -> Tree a -> Bool #

(>=) :: Tree a -> Tree a -> Bool #

max :: Tree a -> Tree a -> Tree a #

min :: Tree a -> Tree a -> Tree a #

identity :: Identity a -> a Source #

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

nNode :: Eq a => a -> Table a -> (Table a, Integer) Source #

lookup :: Eq a => a -> Table a -> Integer Source #

runST :: State a b -> b Source #