ref: c51da4457f664504247f485cbb177e1d851e8cb5
parent: 251933cc92f6026afdec9591c3f12cb8a894e357
author: Lennart Augustsson <lennart@augustsson.net>
date: Wed Nov 8 10:58:12 EST 2023
Fix export bug
--- a/TODO
+++ b/TODO
@@ -47,7 +47,8 @@
* Parser cannot handle
x :+ y == x' :+ y'
probably needs total merge of pattern&expression with validation in type checker
+* Parse pre4fix negation
Bugs
- * default methods not exported
+
--- a/lib/Data/Int.hs
+++ b/lib/Data/Int.hs
@@ -58,7 +58,6 @@
show = showInt_
-- XXX these should not be exported
--- XXX wrong for minInt
showInt_ :: Int -> String
showInt_ n =
if n < 0 then
--- a/lib/Data/Integer_Type.hs
+++ b/lib/Data/Integer_Type.hs
@@ -17,7 +17,7 @@
_intToInteger :: Int -> Integer
_intToInteger i | i `primIntGE` 0 = I Plus (f i)
- | i `primIntEQ` ni = I Minus [0::Int,0::Int,2::Int] -- we are at minBound::Int. XXX deal with this in a more portable way.
+ | i `primIntEQ` ni = I Minus [0::Int,0::Int,2::Int] -- we are at minBound::Int.
| True = I Minus (f ni)
where
ni = (0::Int) `primIntSub` i
--- a/lib/Data/Num.hs
+++ b/lib/Data/Num.hs
@@ -2,7 +2,6 @@
-- See LICENSE file for full license.
module Data.Num(module Data.Num) where
import Primitives
---Yimport PrimFromInteger
import Data.Integer_Type
infixl 6 +,-
@@ -16,9 +15,7 @@
abs :: a -> a
signum :: a -> a
fromInteger :: Integer -> a
---Y{-negate x = 0 - x
---Y-}
subtract :: forall a . Num a => a -> a -> a
subtract x y = y - x
--- a/lib/Data/RealFloat.hs
+++ b/lib/Data/RealFloat.hs
@@ -1,6 +1,5 @@
module Data.RealFloat(
- --RealFloat(..), BUG
- module Data.RealFloat,
+ RealFloat(..),
) where
import Primitives
import Data.Bool
--- a/src/MicroHs/TypeCheck.hs
+++ b/src/MicroHs/TypeCheck.hs
@@ -976,7 +976,7 @@
Type lhs t -> addLHSKind lhs (getTypeKind t)
Class _ lhs@(i, _) _ ms -> do
addLHSKind lhs kConstraint
- addAssoc i [ m | BSign m _ <- ms ]
+ addAssoc i [ x | BSign m _ <- ms, x <- [m, mkDefaultMethodId m] ]
_ -> return ()
getTypeKind :: EType -> EKind
--
⑨