Skip to content

i-am-tom/dagmore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dagmore 🍕 ⛑

She was like a candle in the wind... unreliable. - Dean Learner

Dagmore is a DSL for constructing heterogenous computations representable as DAGs. It bears a lot of similarity to Dagless, its spiritual older brother, but uses rank-2 polymorphism to provide similar guarantees without the compile-time overhead or IxMonad/do-notation trickery!


See the Test directory for fully-worked examples!

main = run do
  acceleration <- fetch @Acceleration
  mass         <- fetch @Mass
  displacement <- fetch @Displacement

  force <- using (mass, acceleration) $ \(m, a) -> do
    Mass         m' <- m
    Acceleration a' <- a

    pure (Force (m' * a'))

  using (force, displacement) $ \(f, d) -> do
    Force        f' <- f
    Displacement d' <- d

    pure (Energy (f' * d'))

About

Less Type, more Typeable.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published