diff options
author | Adam Gundry <adam@well-typed.com> | 2015-10-16 13:58:52 +0100 |
---|---|---|
committer | Adam Gundry <adam@well-typed.com> | 2015-10-16 13:58:52 +0100 |
commit | 5a1b4f814f74ec1c48152d97523744518e212777 (patch) | |
tree | 7c2207ecacbd37f12c78dbcf9d4334827164e0fb /utils/mkUserGuidePart/DList.hs | |
parent | 6757950cdd8bb0af0355539987ee78401a6a8f6b (diff) | |
parent | 808bbdf08058785ae5bc59b5b4f2b04951d4cbbf (diff) | |
download | haskell-wip/orf-reboot.tar.gz |
Merge remote-tracking branch 'origin/master' into wip/orf-rebootwip/orf-reboot
Conflicts:
compiler/rename/RnNames.hs
compiler/typecheck/TcRnMonad.hs
utils/haddock
Diffstat (limited to 'utils/mkUserGuidePart/DList.hs')
-rw-r--r-- | utils/mkUserGuidePart/DList.hs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/utils/mkUserGuidePart/DList.hs b/utils/mkUserGuidePart/DList.hs new file mode 100644 index 0000000000..c4b9283e52 --- /dev/null +++ b/utils/mkUserGuidePart/DList.hs @@ -0,0 +1,13 @@ +module DList where + +newtype DList a = DList ([a] -> [a]) + +snoc :: DList a -> a -> DList a +DList f `snoc` x = DList (f . (x:)) + +toList :: DList a -> [a] +toList (DList f) = f [] + +instance Monoid (DList a) where + mempty = DList id + DList a `mappend` DList b = DList (a . b) |