1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE FlexibleContexts #-}
3 {-# LANGUAGE FlexibleInstances #-}
4 {-# LANGUAGE MultiParamTypeClasses #-}
5 {-# OPTIONS_GHC -fno-warn-orphans #-}
7 module Hcompta.Lib.Consable where
10 import Data.Functor.Compose (Compose(..))
11 --import Control.Applicative (Const(..))
13 class Monoid (ts t) => Consable ts t where
14 mcons :: t -> ts t -> ts t
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