1 {-# LANGUAGE DefaultSignatures #-}
2 {-# LANGUAGE NoImplicitPrelude #-}
3 {-# OPTIONS_GHC -fno-warn-tabs #-}
5 module Hcompta.Expr.If where
7 import Control.Monad (Monad(..), when)
10 import Hcompta.Expr.Dup
14 class Expr_If repr where
15 default if_ :: Monad repr => repr Bool -> repr a -> repr a -> repr a
16 default when_ :: Monad repr => repr Bool -> repr () -> repr ()
18 if_ :: repr Bool -> repr a -> repr a -> repr a
23 when_ :: repr Bool -> repr () -> repr ()
28 instance -- Expr_If Dup
31 ) => Expr_If (Dup r1 r2) where
32 if_ (c1 `Dup` c2) (ok1 `Dup` ok2) (ko1 `Dup` ko2) =
35 when_ (c1 `Dup` c2) (ok1 `Dup` ok2) =