| ||||||||
| ||||||||
Description | ||||||||
A monad transformer for the creation of Lists. Similar to Python's generators. import Control.Monad.DList (toListT) import Control.Monad.Identity (Identity(..)) import Data.List.Class (toList) hanoi 0 _ _ _ = mempty hanoi n from to other = generate $ do yields $ hanoi (n-1) from other to yield (from, to) yields $ hanoi (n-1) other to from > runIdentity . toList . toListT $ hanoi 3 'A' 'B' 'C' :: [(Char, Char)] [('A','B'),('A','C'),('B','C'),('A','B'),('C','A'),('C','B'),('A','B')] | ||||||||
Synopsis | ||||||||
| ||||||||
Documentation | ||||||||
| ||||||||
| ||||||||
| ||||||||
O(1), Transform a GeneratorT to a DListT | ||||||||
| ||||||||
O(1), Output a result value | ||||||||
| ||||||||
O(1), Output all the values of a DListT. | ||||||||
Produced by Haddock version 2.6.0 |