shithub: MicroHs

Download patch

ref: a7220507588a945051a5afaed30d567b082fe628
parent: f88a111d4ab2ff47d3058909cd9cc9d0371caf23
author: Lennart Augustsson <lennart@augustsson.net>
date: Sat Dec 30 01:15:32 EST 2023

Found a bug.

--- a/TODO
+++ b/TODO
@@ -40,4 +40,6 @@
   - In evaluator
 * Fix bug uncovered by Data.Type.Equality
 * mkQIdent
-* Do not use the C stack during evaluation
\ No newline at end of file
+* Do not use the C stack during evaluation
+* Fix bug:
+  foo :: forall e . Dict (Exception e) -> e -> String; foo d e = withDict d (displayException e)
--- a/lib/Data/Constraint.hs
+++ b/lib/Data/Constraint.hs
@@ -6,10 +6,11 @@
 
 -- A very, very minimal version of the constraints package
 
-data Dict (c :: Constraint) = c => Dict
+type Dict :: Constraint -> Type
+data Dict c = c => Dict
 
-instance forall (c :: Constraint) . Show (Dict c) where
+instance forall c . Show (Dict c) where
   showsPrec _ Dict = showString "Dict"
 
-withDict :: forall (c :: Constraint) r . Dict c -> (c => r) -> r
+withDict :: forall c r . Dict c -> (c => r) -> r
 withDict Dict r = r
--