Skip to content

carabolic/gencom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Example (envisioned)

    data Customer = Customer Int String Int
    cId :: Generator Int
    cId = unqiue $ range 1 100
cName :: Generator String
cName = undefined
cAge :: Generator Int
cAge = random $ range 0 120

Combining indenpendent generators using applicative notation

customerA :: Generator Customer
customerA = return $ Customer <$> cId <*> cName <*> cAge

Combining dependent generators using monad notation

customerM :: Generator (Int, String)
customerM = do
  custId <- cId
  prefCustId <- "cust" ++ show custId
  return (custId, prefCustId)

About

Generator combinators for Haskell

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published