semiring-num-1.5.0.0: Basic semiring class and instances

Data.Semiring.Free

Description

The Free semiring.

Synopsis

newtype Free a Source #

The free semiring

Constructors

Fields

Instances

Methods

fold :: Monoid m => Free m -> m #

foldMap :: Monoid m => (a -> m) -> Free a -> m #

foldr :: (a -> b -> b) -> b -> Free a -> b #

foldr' :: (a -> b -> b) -> b -> Free a -> b #

foldl :: (b -> a -> b) -> b -> Free a -> b #

foldl' :: (b -> a -> b) -> b -> Free a -> b #

foldr1 :: (a -> a -> a) -> Free a -> a #

foldl1 :: (a -> a -> a) -> Free a -> a #

toList :: Free a -> [a] #

null :: Free a -> Bool #

length :: Free a -> Int #

elem :: Eq a => a -> Free a -> Bool #

maximum :: Ord a => Free a -> a #

minimum :: Ord a => Free a -> a #

sum :: Num a => Free a -> a #

product :: Num a => Free a -> a #

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

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

(+) :: Free a -> Free a -> Free a #

(-) :: Free a -> Free a -> Free a #

(*) :: Free a -> Free a -> Free a #

negate :: Free a -> Free a #

abs :: Free a -> Free a #

signum :: Free a -> Free a #

fromInteger :: Integer -> Free a #

compare :: Free a -> Free a -> Ordering #

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

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

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

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

max :: Free a -> Free a -> Free a #

min :: Free a -> Free a -> Free a #

readsPrec :: Int -> ReadS (Free a) #

readList :: ReadS [Free a] #

readPrec :: ReadPrec (Free a) #

readListPrec :: ReadPrec [Free a] #

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

show :: Free a -> String #

showList :: [Free a] -> ShowS #

zero :: Free a Source #

one :: Free a Source #

(<.>) :: Free a -> Free a -> Free a Source #

(<+>) :: Free a -> Free a -> Free a Source #

add :: [Free a] -> Free a Source #

mul :: [Free a] -> Free a Source #

liftFree :: a -> Free a Source #

lowerFree :: Semiring s => Free s -> s Source #

Run a Free, interpreting it in the underlying semiring.

Free

runFree :: Semiring s => (a -> s) -> Free a -> s Source #

Run a Free.