]> Git — Sourcephile - comptalang.git/blob - lib/Hcompta/Lib/Consable.hs
Ajout : Filter : simplify et context.
[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 Control.Applicative (Const(..))
10 import Data.Functor.Compose (Compose(..))
11 import Data.Monoid ()
12
13 class Monoid (xs x) => Consable context xs x where
14 mcons :: context -> x -> xs x -> xs x
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