directory-layout- Declare, construct and verify directory layout

Safe HaskellNone



Free monad based directory layouts



data Node a Source

A representation of directory layouts


  • F second argument is never D _ _ _ or F _ _ _ itself
  • F third argument is never T _ _
  • D second argument is never T _ _
  • D third argument is never T _ _


E !a

Emptyness, nothing found here

T !Text !a

File contents

F !FilePath !Layout !(Node a)

File node

D !FilePath !Layout !(Node a)

Directory node


Monad Node

All this crazy stuff is only to get do-notation basically.

Bind (<-) in that do-notation is useless at best (You only can get ()s from Layout) and harmful at worst (If you manage to create your own Node values with something more interesting than ())

Functor Node 
Applicative Node 
Foldable Node 
Traversable Node 
Apply Node 
Bind Node 
Eq a => Eq (Node a) 
Ord a => Ord (Node a) 
Read a => Read (Node a) 
Show a => Show (Node a) 
Default a => Monoid (Node a) 
Default a => Default (Node a) 
Semigroup (Node a) 

type Layout = Node ()Source

Type synonym to save some acrobatics