]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Lib/Consable.hs
Modification : filtre dès la lecture pour moins de consommation mémoire.
[comptalang.git] / lib / Hcompta / Lib / Consable.hs
1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE FlexibleContexts #-}
3 {-# LANGUAGE FlexibleInstances #-}
4 {-# LANGUAGE MultiParamTypeClasses #-}
5 {-# OPTIONS_GHC -fno-warn-orphans #-}
6
7 module Hcompta.Lib.Consable where
8
9 import Data.Monoid ()
10 import Data.Functor.Compose (Compose(..))
11 --import Control.Applicative (Const(..))
12
13 class Monoid (ts t) => Consable ts t where
14 mcons :: t -> ts t -> ts t
15
16 instance Monoid (f (g x)) => Monoid ((Compose f g) x) where
17 mempty = Compose mempty
18 mappend (Compose x) (Compose y) = Compose $ mappend x y