diff --git a/Makefile b/Makefile index 873199d0..15bafcbb 100644 --- a/Makefile +++ b/Makefile @@ -213,8 +213,8 @@ nfibtest: bin/mhs bin/mhseval ###### -VERSION=0.11.0.0 -HVERSION=0,11,0,0 +VERSION=0.11.1.0 +HVERSION=0,11,1,0 MCABAL=$(HOME)/.mcabal MCABALMHS=$(MCABAL)/mhs-$(VERSION) MDATA=$(MCABALMHS)/packages/mhs-$(VERSION)/data diff --git a/MicroHs.cabal b/MicroHs.cabal index 32c11d0d..3728000e 100644 --- a/MicroHs.cabal +++ b/MicroHs.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: MicroHs -version: 0.11.0.0 +version: 0.11.1.0 -- *** When changing the version number, also -- *** run 'sh updateversion.sh' -- *** Yeah, it stinks. diff --git a/generated/mhs.c b/generated/mhs.c index 21eb4406..ddd95e4e 100644 --- a/generated/mhs.c +++ b/generated/mhs.c @@ -4914,7 +4914,7 @@ static unsigned char data[] = { 52,161,18,1,95,50,77,232,1,58,50,77,255,96,190,237,208,5,237,220, 16,160,174,140,229,224,135,1,8,118,55,46,48,92,49,48,38,34,96,83, 209,16,0,53,96,144,111,75,64,116,128,19,0,57,66,8,0,48,174,237, -96,6,128,12,0,48,226,25,0,0,58,96,51,128,45,79,156,0,53,130, +128,6,96,5,0,48,226,25,0,0,58,96,51,128,45,79,156,0,53,130, 14,0,85,64,10,193,109,65,231,0,53,65,202,239,36,3,66,148,128,67, 3,95,50,48,48,65,77,89,128,225,100,0,0,53,208,196,96,60,123,42, 2,50,53,53,64,157,0,53,129,126,130,99,67,17,162,77,179,202,116,142, @@ -4923,83 +4923,83 @@ static unsigned char data[] = { 178,146,241,0,53,110,208,243,50,8,191,12,0,58,96,51,242,242,0,2, 111,117,116,65,26,208,194,163,4,242,241,0,241,125,35,178,52,177,124,0, 58,64,140,192,84,85,95,0,80,64,169,64,28,145,11,1,95,52,96,44, -1,54,32,119,232,88,42,96,15,80,127,0,58,96,98,154,111,96,17,111, -37,4,97,108,108,111,99,64,16,162,238,0,51,83,37,64,165,147,37,64, -82,239,159,1,3,95,50,52,51,131,200,1,52,50,222,246,0,58,65,50, -128,145,1,95,50,68,136,192,207,97,67,64,47,96,153,193,2,64,25,64, -54,64,13,66,6,121,35,96,69,178,2,3,112,117,116,98,64,130,194,157, -3,51,55,32,79,64,6,0,56,66,79,147,8,98,80,0,58,96,71,83, -13,0,50,99,227,0,58,96,26,64,15,111,160,0,58,96,49,96,150,0, -83,246,125,0,0,90,160,7,128,9,160,10,242,62,3,213,47,230,57,1, -225,0,5,175,176,1,50,50,66,37,130,99,64,26,81,208,0,51,161,33, -240,154,4,3,66,97,100,32,157,142,3,32,109,111,100,254,222,0,116,152, -162,147,0,51,196,151,113,14,0,90,160,4,151,89,241,48,2,100,161,1, -50,51,66,233,98,214,119,110,241,33,7,64,85,65,52,0,55,84,32,64, -32,115,117,1,50,112,64,13,162,224,1,52,57,64,193,185,246,224,5,0, -69,22,127,3,211,25,123,213,1,49,50,166,8,224,6,9,224,42,2,64, -15,128,48,224,42,30,160,28,224,49,10,224,42,15,224,49,10,224,42,22, -224,49,3,214,28,97,161,0,58,96,6,227,149,2,70,255,97,145,0,49, -98,52,130,133,97,96,117,190,66,15,0,58,96,28,194,226,117,137,64,28, -128,16,67,213,0,50,149,164,87,229,0,58,96,32,228,100,0,0,50,132, -100,128,52,64,38,3,10,65,32,82,161,95,0,58,96,28,160,138,89,93, -132,21,0,80,161,226,64,171,67,48,146,242,225,145,2,0,58,96,179,96, -55,0,85,131,141,66,2,0,73,128,48,198,60,102,251,96,17,163,129,243, -214,1,0,58,98,228,224,119,2,249,10,2,0,80,158,31,0,49,128,79, -162,240,179,168,128,148,147,199,2,64,64,64,99,66,0,58,67,242,194,88, -1,95,50,85,43,161,109,71,146,64,30,129,40,7,115,101,113,117,97,108, -32,58,96,33,64,46,162,217,3,95,50,49,54,227,47,2,5,77,72,83, -68,73,82,99,38,0,80,64,78,97,60,226,227,0,1,58,50,191,63,224, -19,0,230,97,2,0,58,96,45,165,5,195,55,96,203,104,27,150,10,245, -129,19,247,177,5,1,95,50,127,110,224,126,1,245,135,1,223,171,1,50, -49,67,102,191,93,11,112,101,101,107,67,65,83,116,114,105,110,103,64,21, -163,110,1,57,50,103,70,0,58,96,102,227,127,0,133,227,255,191,1,1, -95,50,104,220,192,6,129,64,96,159,0,58,96,6,6,10,65,32,116,111, -73,110,70,83,191,135,6,94,103,101,116,101,110,118,64,16,167,152,225,80, -0,0,52,159,20,225,2,2,245,207,0,166,133,225,81,1,1,95,50,95, -119,64,102,191,139,65,117,228,193,4,3,116,97,105,108,97,143,0,65,64, -197,191,165,64,71,65,238,95,141,64,67,98,204,191,180,70,93,191,179,2, -95,51,48,128,80,96,151,95,106,64,219,69,58,128,56,0,49,75,213,224, -11,0,224,80,0,0,58,96,6,129,230,0,52,73,33,89,245,160,61,0, -50,224,155,3,0,101,91,20,0,58,138,40,169,95,96,38,0,58,96,6, -96,128,251,89,15,6,67,111,110,116,114,111,108,251,87,11,96,18,2,67, -97,108,128,246,166,107,191,187,102,74,230,73,3,64,7,189,5,190,225,2, -39,32,95,68,68,138,99,97,109,0,57,100,175,71,174,168,140,137,10,0, -50,200,152,131,105,0,58,64,165,64,99,118,108,64,14,196,115,232,233,8, -163,138,232,220,2,0,58,100,123,96,160,0,85,225,193,7,16,109,100,53, -67,111,109,98,105,110,101,58,32,101,109,112,116,121,134,133,64,143,68,106, -74,79,160,169,101,32,70,118,185,43,0,56,73,171,64,88,1,64,89,96, -127,65,11,103,17,68,52,228,25,1,196,176,233,106,2,224,253,3,120,251, -96,54,72,200,0,49,92,159,98,160,2,52,49,32,157,102,0,95,88,156, -1,95,49,123,187,160,0,0,58,97,52,66,231,9,109,100,53,65,114,114, -97,121,32,58,96,57,130,124,194,235,0,55,192,160,1,95,49,92,95,99, -224,231,175,4,231,67,3,3,95,49,57,53,224,46,5,163,136,251,33,1, -0,56,129,184,227,32,1,1,95,49,93,9,160,145,226,223,0,96,20,186, -123,65,0,137,39,67,105,1,53,56,204,223,140,87,151,226,224,106,0,225, -58,3,192,25,168,133,191,24,0,67,127,5,172,16,94,82,97,34,3,95, -49,55,55,100,71,128,0,229,148,3,191,91,202,56,232,48,0,64,186,171, -22,224,44,0,96,95,0,66,133,225,1,51,54,161,125,106,40,255,36,4, -232,86,4,224,43,10,194,134,229,26,2,96,16,0,58,65,96,226,193,0, -204,165,0,58,96,135,99,205,99,134,93,141,225,251,0,129,245,0,35,101, -3,77,160,0,58,97,152,5,10,65,32,35,49,54,65,103,172,182,1,49, -48,65,232,124,6,92,90,1,95,49,130,49,0,56,78,246,126,30,2,95, -49,56,192,91,64,11,64,45,160,11,1,57,48,224,11,1,91,48,0,58, -96,12,255,184,2,137,4,137,7,66,47,160,2,225,58,6,97,170,128,50, -161,237,165,193,134,58,111,15,159,252,96,15,96,164,125,231,174,160,93,173, -64,33,131,66,224,33,7,192,139,0,95,77,167,224,38,16,224,71,25,6, -64,64,83,32,73,32,64,142,242,192,84,224,194,0,67,167,0,83,162,121, -96,60,74,46,224,76,16,128,22,99,169,66,135,224,40,16,130,155,195,248, -97,40,67,83,0,53,224,167,21,129,43,97,172,72,209,65,166,162,57,239, -179,2,96,27,224,21,1,96,49,0,58,96,140,224,42,2,160,20,221,11, -239,32,4,0,58,96,113,160,44,64,13,194,159,224,37,7,130,161,225,253, -0,65,41,74,61,0,50,64,180,76,71,0,58,66,83,195,242,131,183,1, -95,49,94,140,71,21,66,123,224,27,11,128,114,252,65,6,160,174,220,56, -1,48,52,69,215,99,10,99,243,65,43,93,231,130,172,1,64,58,98,244, -137,190,0,49,71,21,225,109,1,0,58,96,39,101,242,128,117,113,155,129, -218,164,73,79,93,228,136,1,204,84,64,34,1,64,95,78,70,136,134,0, -48,69,165,1,55,50,230,49,2,27,92,51,52,38,108,105,98,47,68,97, -116,97,47,73,110,116,101,103,101,114,95,84,121,112,101,46,104,115,64,27, -4,44,50,56,58,49,241,227,0,96,178,99,159,97,78,0,85,161,215,224, -18,0,240,78,3,3,79,32,35,50,244,14,2,224,60,3,105,109,96,60, +0,54,97,194,67,26,115,232,85,88,64,38,129,170,2,73,32,58,96,17, +111,37,4,97,108,108,111,99,64,16,162,238,0,51,83,37,64,165,147,37, +64,82,239,159,1,3,95,50,52,51,131,200,1,52,50,222,246,0,58,65, +50,128,145,1,95,50,68,136,192,207,97,67,64,47,96,153,193,2,64,25, +64,54,64,13,66,6,121,35,96,69,178,2,3,112,117,116,98,64,130,194, +157,3,51,55,32,79,64,6,0,56,66,79,147,8,98,80,0,58,96,71, +83,13,0,50,99,227,0,58,96,26,64,15,111,160,0,58,96,49,96,150, +0,83,246,125,0,0,90,160,7,128,9,160,10,242,62,3,213,47,230,57, +1,225,0,5,175,176,1,50,50,66,37,130,99,64,26,81,208,0,51,161, +33,240,154,4,3,66,97,100,32,157,142,3,32,109,111,100,254,222,0,116, +152,162,147,0,51,196,151,113,14,0,90,160,4,151,89,241,48,2,100,161, +1,50,51,66,233,98,214,119,110,241,33,7,64,85,65,52,0,55,84,32, +64,32,115,117,1,50,112,64,13,162,224,1,52,57,64,193,185,246,224,5, +0,69,22,127,3,211,25,123,213,1,49,50,166,8,224,6,9,224,42,2, +64,15,128,48,224,42,30,160,28,224,49,10,224,42,15,224,49,10,224,42, +22,224,49,3,214,28,97,161,0,58,96,6,227,149,2,70,255,97,145,0, +49,98,52,130,133,97,96,117,190,66,15,0,58,96,28,194,226,117,137,64, +28,128,16,67,213,0,50,149,164,87,229,0,58,96,32,228,100,0,0,50, +132,100,128,52,64,38,3,10,65,32,82,161,95,0,58,96,28,160,138,89, +93,132,21,0,80,161,226,64,171,67,48,146,242,225,145,2,0,58,96,179, +96,55,0,85,131,141,66,2,0,73,128,48,198,60,102,251,96,17,163,129, +243,214,1,0,58,98,228,224,119,2,249,10,2,0,80,158,31,0,49,128, +79,162,240,179,168,128,148,147,199,2,64,64,64,99,66,0,58,67,242,194, +88,1,95,50,85,43,161,109,71,146,64,30,129,40,7,115,101,113,117,97, +108,32,58,96,33,64,46,162,217,3,95,50,49,54,227,47,2,5,77,72, +83,68,73,82,99,38,0,80,64,78,97,60,226,227,0,1,58,50,191,63, +224,19,0,230,97,2,0,58,96,45,165,5,195,55,96,203,104,27,150,10, +245,129,19,247,177,5,1,95,50,127,110,224,126,1,245,135,1,223,171,1, +50,49,67,102,191,93,11,112,101,101,107,67,65,83,116,114,105,110,103,64, +21,163,110,1,57,50,103,70,0,58,96,102,227,127,0,133,227,255,191,1, +1,95,50,104,220,192,6,129,64,96,159,0,58,96,6,6,10,65,32,116, +111,73,110,70,83,191,135,6,94,103,101,116,101,110,118,64,16,167,152,225, +80,0,0,52,159,20,225,2,2,245,207,0,166,133,225,81,1,1,95,50, +95,119,64,102,191,139,65,117,228,193,4,3,116,97,105,108,97,143,0,65, +64,197,191,165,64,71,65,238,95,141,64,67,98,204,191,180,70,93,191,179, +2,95,51,48,128,80,96,151,95,106,64,219,69,58,128,56,0,49,75,213, +224,11,0,224,80,0,0,58,96,6,129,230,0,52,73,33,89,245,160,61, +0,50,224,155,3,0,101,91,20,0,58,138,40,169,95,96,38,0,58,96, +6,96,128,251,89,15,6,67,111,110,116,114,111,108,251,87,11,96,18,2, +67,97,108,128,246,166,107,191,187,102,74,230,73,3,64,7,189,5,190,225, +2,39,32,95,68,68,138,99,97,109,0,57,100,175,71,174,168,140,137,10, +0,50,200,152,131,105,0,58,64,165,64,99,118,108,64,14,196,115,232,233, +8,163,138,232,220,2,0,58,100,123,96,160,0,85,225,193,7,16,109,100, +53,67,111,109,98,105,110,101,58,32,101,109,112,116,121,134,133,64,143,68, +106,74,79,160,169,101,32,70,118,185,43,0,56,73,171,64,88,1,64,89, +96,127,65,11,103,17,68,52,228,25,1,196,176,233,106,2,224,253,3,120, +251,96,54,72,200,0,49,92,159,98,160,2,52,49,32,157,102,0,95,88, +156,1,95,49,123,187,160,0,0,58,97,52,66,231,9,109,100,53,65,114, +114,97,121,32,58,96,57,130,124,194,235,0,55,192,160,1,95,49,92,95, +99,224,231,175,4,231,67,3,3,95,49,57,53,224,46,5,163,136,251,33, +1,0,56,129,184,227,32,1,1,95,49,93,9,160,145,226,223,0,96,20, +186,123,65,0,137,39,67,105,1,53,56,204,223,140,87,151,226,224,106,0, +225,58,3,192,25,168,133,191,24,0,67,127,5,172,16,94,82,97,34,3, +95,49,55,55,100,71,128,0,229,148,3,191,91,202,56,232,48,0,64,186, +171,22,224,44,0,96,95,0,66,133,225,1,51,54,161,125,106,40,255,36, +4,232,86,4,224,43,10,194,134,229,26,2,96,16,0,58,65,96,226,193, +0,204,165,0,58,96,135,99,205,99,134,93,141,225,251,0,129,245,0,35, +101,3,77,160,0,58,97,152,5,10,65,32,35,49,54,65,103,172,182,1, +49,48,65,232,124,6,92,90,1,95,49,130,49,0,56,78,246,126,30,2, +95,49,56,192,91,64,11,64,45,160,11,1,57,48,224,11,1,91,48,0, +58,96,12,255,184,2,137,4,137,7,66,47,160,2,225,58,6,97,170,128, +50,161,237,165,193,134,58,111,15,159,252,96,15,96,164,125,231,174,160,93, +173,64,33,131,66,224,33,7,192,139,0,95,77,167,224,38,16,224,71,25, +6,64,64,83,32,73,32,64,142,242,192,84,224,194,0,67,167,0,83,162, +121,96,60,74,46,224,76,16,128,22,99,169,66,135,224,40,16,130,155,195, +248,97,40,67,83,0,53,224,167,21,129,43,97,172,72,209,65,166,162,57, +239,179,2,96,27,224,21,1,96,49,0,58,96,140,224,42,2,160,20,221, +11,239,32,4,0,58,96,113,160,44,64,13,194,159,224,37,7,130,161,225, +253,0,65,41,74,61,0,50,64,180,76,71,0,58,66,83,195,242,131,183, +1,95,49,94,140,71,21,66,123,224,27,11,128,114,252,65,6,160,174,220, +56,1,48,52,69,215,99,10,99,243,65,43,93,231,130,172,1,64,58,98, +244,137,190,0,49,71,21,225,109,1,0,58,96,39,101,242,128,117,113,155, +129,218,164,73,79,93,228,136,1,204,84,64,34,1,64,95,78,70,136,134, +0,48,69,165,1,55,50,230,49,2,27,92,51,52,38,108,105,98,47,68, +97,116,97,47,73,110,116,101,103,101,114,95,84,121,112,101,46,104,115,64, +27,4,44,50,56,58,49,241,227,0,96,178,99,159,97,78,0,85,161,215, +224,18,0,240,91,0,128,5,0,50,244,14,2,224,60,3,105,109,96,60, 0,89,160,208,67,155,64,197,0,48,192,197,158,168,100,166,65,15,100,4, 146,3,196,214,98,102,128,18,228,167,1,3,64,95,52,52,133,61,0,58, 97,85,7,10,65,32,114,101,109,32,58,96,64,110,48,0,58,96,126,79, diff --git a/lib/AllOfLib.hs b/lib/AllOfLib.hs index d68818e5..a21164e8 100644 --- a/lib/AllOfLib.hs +++ b/lib/AllOfLib.hs @@ -23,6 +23,7 @@ import Data.Bounded import Data.ByteString import Data.Char import Data.Char_Type +import Data.Coerce import Data.Complex import Data.Constraint import Data.Dynamic diff --git a/lib/libs.cabal b/lib/libs.cabal index b8970ca3..9504c9d3 100644 --- a/lib/libs.cabal +++ b/lib/libs.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: libs -version: 0.11.0.0 +version: 0.11.1.0 license: Apache license-file: LICENSE maintainer: lennart@augustsson.net @@ -34,6 +34,7 @@ library base Data.Bounded Data.ByteString Data.Char + Data.Coerce Data.Complex Data.Constraint Data.Data diff --git a/paths/Paths_MicroHs.hs b/paths/Paths_MicroHs.hs index 86cf5488..3a5e8f01 100644 --- a/paths/Paths_MicroHs.hs +++ b/paths/Paths_MicroHs.hs @@ -10,4 +10,4 @@ getDataDir :: IO FilePath getDataDir = return "." version :: Version -version = makeVersion [0,11,0,0] +version = makeVersion [0,11,1,0] diff --git a/src/MicroHs/TypeCheck.hs b/src/MicroHs/TypeCheck.hs index 9abe9ade..0d5451f2 100644 --- a/src/MicroHs/TypeCheck.hs +++ b/src/MicroHs/TypeCheck.hs @@ -3018,8 +3018,12 @@ extNewtypeSyns :: T () extNewtypeSyns = do dt <- gets dataTable mn <- gets moduleName - let ext (Newtype (i, vs) (Constr _ _ _ et) _) = extSyn (qualIdent mn i) (EForall True vs t) - where t = either (snd . head) (snd . snd . head) et + let ext (Newtype (i, vs) (Constr _ _ _c et) _) = do + -- XXX We should check that the constructor name (_c) is visible. + -- But this is tricky since we don't know under what qualified name it + -- it should be visible. + let t = either (snd . head) (snd . snd . head) et + extSyn (qualIdent mn i) (EForall True vs t) -- extend synonym table ext _ = return () mapM_ ext $ M.elems dt