Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
compiler
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 16
    • Issues 16
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • clean-compiler-and-rts
  • compiler
  • Issues
  • #73

Closed
Open
Opened Sep 16, 2020 by Mart Lubbers@mlubbersDeveloper

generic type information still contains synonyms

The following program:

module test

import StdEnv, StdGeneric

generic g a :: a -> String
g{|Int|} _ = "Int"
g{|RECORD of grd|} f (RECORD a) = grd.grd_name +++ " " +++ f a +++ " (" +++ toString grd.grd_type +++ ")"
g{|FIELD|} f (FIELD a) = f a

instance toString GenType
where
	toString (GenTypeCons a) = a
	toString (GenTypeVar i) = toString i
	toString (GenTypeApp l r) = "(" +++ toString l +++ " " +++ toString r +++ ")"
	toString (GenTypeArrow l r) = "(" +++ toString l +++ "->" +++ toString r +++ ")"

:: Syn :== Int
:: T = {t :: Syn}

derive g T

Start = g{|*|} {t=42}

Produces:

T Int ((Syn->T))

While I expect it (and want it) to produce:

T Int ((Int->T))
To upload designs, you'll need to enable LFS and have admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: clean-compiler-and-rts/compiler#73