]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Lib/Consable.hs
Correction : rétro support de GHC 7.6.3 (Debian/jessie).
[comptalang.git] / lib / Hcompta / Lib / Consable.hs
1 {-# LANGUAGE FlexibleContexts #-}
2 {-# LANGUAGE FlexibleInstances #-}
3 {-# LANGUAGE MultiParamTypeClasses #-}
4 {-# OPTIONS_GHC -fno-warn-orphans #-}
5
6 module Hcompta.Lib.Consable where
7
8 --import Control.Applicative (Const(..))
9 import Data.Functor.Compose (Compose(..))
10 import Data.Monoid (Monoid(..))
11
12 class Monoid (xs x) => Consable context xs x where
13 mcons :: context -> x -> xs x -> xs x
14
15 instance Monoid (f (g x)) => Monoid ((Compose f g) x) where
16 mempty = Compose mempty
17 mappend (Compose x) (Compose y) = Compose (mappend x y)