lude

Haskell prelude alternative
git clone git://git.rr3.xyz/lude | git clone gits://git.rr3.xyz/lude
Log | Files | Refs | README | LICENSE

Development.hs (959B)


      1 module Lude.Development (
      2     Todo,
      3     unimplemented,
      4     todo,
      5 ) where
      6 
      7 import Prelude qualified as Base
      8 
      9 import Lude.Haskell
     10 
     11 --------------------------------------------------------------------------------
     12 
     13 {-# WARNING in "x-todo" Todo "todo left in code" #-}
     14 type family Todo :: forall k. k where
     15 
     16 --------------------------------------------------------------------------------
     17 
     18 type UnimplementedExn :: Type
     19 newtype UnimplementedExn = MkUnimplementedExn Base.String
     20     deriving stock (Base.Show)
     21 instance Exception UnimplementedExn where
     22     displayException (MkUnimplementedExn msg) = "unimplemented: " Base.++ msg
     23 
     24 unimplemented :: forall {r :: Repr} (a :: Type# r). (HasCallStack) => Base.String -> a
     25 unimplemented msg = withFrozenCallStack (unsafe_raise (MkUnimplementedExn msg))
     26 
     27 {-# WARNING in "x-todo" todo "todo left in code" #-}
     28 todo :: forall {r :: Repr} (a :: Type# r). (HasCallStack) => a
     29 todo = withFrozenCallStack (unimplemented "todo")