Guest User

Untitled

a guest
Sep 17th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
F# 1.09 KB | None | 0 0
  1. module Ersatz.Types
  2.  
  3. type Symbol = {
  4.     Module : Module
  5.     Identifier : string
  6. }
  7.  
  8. and Module = {
  9.     Name : string list
  10.     Definitions : (Symbol * Type * Expression) list
  11.     Imports : Module list
  12. }
  13.  
  14. and Kind =
  15.     | Star
  16.     | Kinds of Kind list
  17.  
  18. and PrimitiveType =
  19.     | Integer
  20.     | Float
  21.     | Tuple of Types
  22.     | Array of int * Type
  23.     | List of Type
  24.     | Function of Types
  25.  
  26. and Qualifier =
  27.     | Mutable
  28.     | Private
  29.     | Internal
  30. and Qualifiers = Qualifier list
  31.  
  32. and Type' =
  33.    | TypeVariable of Symbol
  34.    | SumType of Types
  35.    | RecordType of (string, Type) Map
  36.    | Primitive of PrimitiveType
  37.    | TypeClass of (Symbol * Types) list
  38.  
  39. and TypeConstraint = (Symbol * Type) list
  40.  
  41. and Type = Type' * Kind * TypeConstraint
  42.  
  43. and Types = Type list
  44.  
  45. and Binding = {
  46.     Variable : Symbol
  47.     Counter : uint64
  48.     Qualifiers : Qualifiers
  49. }
  50.  
  51. and Expression =
  52.     | Progn of Expression list
  53.     | Apply of Expression * Expression
  54.     | Lambda of Binding * Expression
  55.     | If of Expression * Expression * Expression
  56.     | Datum of PrimitiveType
Add Comment
Please, Sign In to add comment