@@ -6,6 +6,8 @@ import Idris.ElabDecls
6import Idris.ElabTerm
6import Idris.ElabTerm
7import Idris.AbsSyntax
7import Idris.AbsSyntax
9import Core.TT
11import Core.TT
10import Core.Evaluate
12import Core.Evaluate
@@ -17,6 +19,7 @@ data Prim = Prim { p_name :: Name,
17 p_arity :: Int,
19 p_arity :: Int,
18 p_def :: [Value] -> Maybe Value,
20 p_def :: [Value] -> Maybe Value,
19 p_epic :: ([E.Name], E.Term),
21 p_epic :: ([E.Name], E.Term),
22+ p_sc :: ([CType], CType, SPrim),
20 p_total :: Totality
23 p_total :: Totality
@@ -79,137 +82,146 @@ partial = Partial NotCovering
79primitives =
82primitives =
80 -- operators
83 -- operators
81 [Prim (UN "prim__addInt") (ty [IType, IType] IType) 2 (iBin (+))
84 [Prim (UN "prim__addInt") (ty [IType, IType] IType) 2 (iBin (+))
82− (eOp E.plus_) total,
85+ (eOp E.plus_) ([sInt, sInt], sInt, AddI) total,
83 Prim (UN "prim__subInt") (ty [IType, IType] IType) 2 (iBin (-))
86 Prim (UN "prim__subInt") (ty [IType, IType] IType) 2 (iBin (-))
84− (eOp E.minus_) total,
87+ (eOp E.minus_)
88+ ([sInt, sInt], sInt, SubI) total,
85 Prim (UN "prim__mulInt") (ty [IType, IType] IType) 2 (iBin (*))
89 Prim (UN "prim__mulInt") (ty [IType, IType] IType) 2 (iBin (*))
86− (eOp E.times_) total,
90+ (eOp E.times_) ([sInt, sInt], sInt, MulI) total,
87 Prim (UN "prim__divInt") (ty [IType, IType] IType) 2 (iBin (div))
91 Prim (UN "prim__divInt") (ty [IType, IType] IType) 2 (iBin (div))
88− (eOp E.divide_) partial,
92+ (eOp E.divide_) ([sInt, sInt], sInt, DivI) partial,
89 Prim (UN "prim__eqInt") (ty [IType, IType] IType) 2 (biBin (==))
93 Prim (UN "prim__eqInt") (ty [IType, IType] IType) 2 (biBin (==))
90− (eOp E.eq_) total,
94+ (eOp E.eq_) ([sInt, sInt], sInt, EqI) total,
91 Prim (UN "prim__ltInt") (ty [IType, IType] IType) 2 (biBin (<))
95 Prim (UN "prim__ltInt") (ty [IType, IType] IType) 2 (biBin (<))
92− (eOp E.lt_) total,
96+ (eOp E.lt_) ([sInt, sInt], sInt, LtI) total,
93 Prim (UN "prim__lteInt") (ty [IType, IType] IType) 2 (biBin (<=))
97 Prim (UN "prim__lteInt") (ty [IType, IType] IType) 2 (biBin (<=))
94− (eOp E.lte_) total,
98+ (eOp E.lte_) ([sInt, sInt], sInt, LteI) total,
95 Prim (UN "prim__gtInt") (ty [IType, IType] IType) 2 (biBin (>))
99 Prim (UN "prim__gtInt") (ty [IType, IType] IType) 2 (biBin (>))
96− (eOp E.gt_) total,
100+ (eOp E.gt_) ([sInt, sInt], sInt, GtI) total,
97 Prim (UN "prim__gteInt") (ty [IType, IType] IType) 2 (biBin (>=))
101 Prim (UN "prim__gteInt") (ty [IType, IType] IType) 2 (biBin (>=))
98− (eOp E.gte_) total,
102+ (eOp E.gte_) ([sInt, sInt], sInt, GteI) total,
99 Prim (UN "prim__eqChar") (ty [ChType, ChType] IType) 2 (bcBin (==))
103 Prim (UN "prim__eqChar") (ty [ChType, ChType] IType) 2 (bcBin (==))
100− (eOp E.eq_) total,
104+ (eOp E.eq_) ([sChar, sChar], sInt, EqC) total,
101 Prim (UN "prim__ltChar") (ty [ChType, ChType] IType) 2 (bcBin (<))
105 Prim (UN "prim__ltChar") (ty [ChType, ChType] IType) 2 (bcBin (<))
102− (eOp E.lt_) total,
106+ (eOp E.lt_) ([sChar, sChar], sInt, LtC) total,
103 Prim (UN "prim__lteChar") (ty [ChType, ChType] IType) 2 (bcBin (<=))
107 Prim (UN "prim__lteChar") (ty [ChType, ChType] IType) 2 (bcBin (<=))
104− (eOp E.lte_) total,
108+ (eOp E.lte_) ([sChar, sChar], sInt, LteC) total,
105 Prim (UN "prim__gtChar") (ty [ChType, ChType] IType) 2 (bcBin (>))
109 Prim (UN "prim__gtChar") (ty [ChType, ChType] IType) 2 (bcBin (>))
106− (eOp E.gt_) total,
110+ (eOp E.gt_) ([sChar, sChar], sInt, GtC) total,
107 Prim (UN "prim__gteChar") (ty [ChType, ChType] IType) 2 (bcBin (>=))
111 Prim (UN "prim__gteChar") (ty [ChType, ChType] IType) 2 (bcBin (>=))
108− (eOp E.gte_) total,
112+ (eOp E.gte_) ([sChar, sChar], sInt, GteC) total,
109 Prim (UN "prim__addBigInt") (ty [BIType, BIType] BIType) 2 (bBin (+))
113 Prim (UN "prim__addBigInt") (ty [BIType, BIType] BIType) 2 (bBin (+))
110− (eOpFn tyBigInt tyBigInt "addBig") total,
114+ (eOpFn tyBigInt tyBigInt "addBig")
115+ ([sBigInt, sBigInt], sBigInt, AddBI) total,
111 Prim (UN "prim__subBigInt") (ty [BIType, BIType] BIType) 2 (bBin (-))
116 Prim (UN "prim__subBigInt") (ty [BIType, BIType] BIType) 2 (bBin (-))
112− (eOpFn tyBigInt tyBigInt "subBig") total,
117+ (eOpFn tyBigInt tyBigInt "subBig") ([sBigInt, sBigInt], sBigInt, SubBI) total,
113 Prim (UN "prim__mulBigInt") (ty [BIType, BIType] BIType) 2 (bBin (*))
118 Prim (UN "prim__mulBigInt") (ty [BIType, BIType] BIType) 2 (bBin (*))
114− (eOpFn tyBigInt tyBigInt "mulBig") total,
119+ (eOpFn tyBigInt tyBigInt "mulBig") ([sBigInt, sBigInt], sBigInt, MulBI) total,
115 Prim (UN "prim__divBigInt") (ty [BIType, BIType] BIType) 2 (bBin (div))
120 Prim (UN "prim__divBigInt") (ty [BIType, BIType] BIType) 2 (bBin (div))
116− (eOpFn tyBigInt tyBigInt "divBig") partial,
121+ (eOpFn tyBigInt tyBigInt "divBig") ([sBigInt, sBigInt], sBigInt,DivBI) partial,
117 Prim (UN "prim__eqBigInt") (ty [BIType, BIType] IType) 2 (bbBin (==))
122 Prim (UN "prim__eqBigInt") (ty [BIType, BIType] IType) 2 (bbBin (==))
118− (eOpFn tyBigInt tyInt "eqBig") total,
123+ (eOpFn tyBigInt tyInt "eqBig") ([sBigInt, sBigInt], sInt, EqBI) total,
119 Prim (UN "prim__ltBigInt") (ty [BIType, BIType] IType) 2 (bbBin (<))
124 Prim (UN "prim__ltBigInt") (ty [BIType, BIType] IType) 2 (bbBin (<))
120− (eOpFn tyBigInt tyInt "ltBig") total,
125+ (eOpFn tyBigInt tyInt "ltBig") ([sBigInt, sBigInt], sInt, LtBI) total,
121 Prim (UN "prim__lteBigInt") (ty [BIType, BIType] IType) 2 (bbBin (<=))
126 Prim (UN "prim__lteBigInt") (ty [BIType, BIType] IType) 2 (bbBin (<=))
122− (eOpFn tyBigInt tyInt "leBig") total,
127+ (eOpFn tyBigInt tyInt "leBig") ([sBigInt, sBigInt], sInt, LteBI) total,
123 Prim (UN "prim__gtBigInt") (ty [BIType, BIType] IType) 2 (bbBin (>))
128 Prim (UN "prim__gtBigInt") (ty [BIType, BIType] IType) 2 (bbBin (>))
124− (eOpFn tyBigInt tyInt "gtBig") total,
129+ (eOpFn tyBigInt tyInt "gtBig") ([sBigInt, sBigInt], sInt, GtBI) total,
125 Prim (UN "prim__gtBigInt") (ty [BIType, BIType] IType) 2 (bbBin (>=))
130 Prim (UN "prim__gtBigInt") (ty [BIType, BIType] IType) 2 (bbBin (>=))
126− (eOpFn tyBigInt tyInt "geBig") total,
131+ (eOpFn tyBigInt tyInt "geBig") ([sBigInt, sBigInt], sInt, GteBI) total,
127 Prim (UN "prim__addFloat") (ty [FlType, FlType] FlType) 2 (fBin (+))
132 Prim (UN "prim__addFloat") (ty [FlType, FlType] FlType) 2 (fBin (+))
128− (eOp E.plusF_) total,
133+ (eOp E.plusF_) ([sFloat, sFloat], sFloat, AddF) total,
129 Prim (UN "prim__subFloat") (ty [FlType, FlType] FlType) 2 (fBin (-))
134 Prim (UN "prim__subFloat") (ty [FlType, FlType] FlType) 2 (fBin (-))
130− (eOp E.minusF_) total,
135+ (eOp E.minusF_) ([sFloat, sFloat], sFloat, SubF) total,
131 Prim (UN "prim__mulFloat") (ty [FlType, FlType] FlType) 2 (fBin (*))
136 Prim (UN "prim__mulFloat") (ty [FlType, FlType] FlType) 2 (fBin (*))
132− (eOp E.timesF_) total,
137+ (eOp E.timesF_) ([sFloat, sFloat], sFloat, MulF) total,
133 Prim (UN "prim__divFloat") (ty [FlType, FlType] FlType) 2 (fBin (/))
138 Prim (UN "prim__divFloat") (ty [FlType, FlType] FlType) 2 (fBin (/))
134− (eOp E.divideF_) total,
139+ (eOp E.divideF_) ([sFloat, sFloat], sFloat, DivF) total,
135 Prim (UN "prim__eqFloat") (ty [FlType, FlType] IType) 2 (bfBin (==))
140 Prim (UN "prim__eqFloat") (ty [FlType, FlType] IType) 2 (bfBin (==))
136− (eOp E.eqF_) total,
141+ (eOp E.eqF_) ([sFloat, sFloat], sInt, EqF) total,
137 Prim (UN "prim__ltFloat") (ty [FlType, FlType] IType) 2 (bfBin (<))
142 Prim (UN "prim__ltFloat") (ty [FlType, FlType] IType) 2 (bfBin (<))
138− (eOp E.ltF_) total,
143+ (eOp E.ltF_) ([sFloat, sFloat], sInt, LtF) total,
139 Prim (UN "prim__lteFloat") (ty [FlType, FlType] IType) 2 (bfBin (<=))
144 Prim (UN "prim__lteFloat") (ty [FlType, FlType] IType) 2 (bfBin (<=))
140− (eOp E.lteF_) total,
145+ (eOp E.lteF_) ([sFloat, sFloat], sInt, LteF) total,
141 Prim (UN "prim__gtFloat") (ty [FlType, FlType] IType) 2 (bfBin (>))
146 Prim (UN "prim__gtFloat") (ty [FlType, FlType] IType) 2 (bfBin (>))
142− (eOp E.gtF_) total,
147+ (eOp E.gtF_) ([sFloat, sFloat], sInt, GtF) total,
143 Prim (UN "prim__gteFloat") (ty [FlType, FlType] IType) 2 (bfBin (>=))
148 Prim (UN "prim__gteFloat") (ty [FlType, FlType] IType) 2 (bfBin (>=))
144− (eOp E.gteF_) total,
149+ (eOp E.gteF_) ([sFloat, sFloat], sInt, GteF) total,
145 Prim (UN "prim__concat") (ty [StrType, StrType] StrType) 2 (sBin (++))
150 Prim (UN "prim__concat") (ty [StrType, StrType] StrType) 2 (sBin (++))
146− ([E.name "x", E.name "y"], (fun "append") @@ fun "x" @@ fun "y") total,
151+ ([E.name "x", E.name "y"], (fun "append") @@ fun "x" @@ fun "y")
152+ ([sString, sString], sString, ConcatS) total,
147 Prim (UN "prim__eqString") (ty [StrType, StrType] IType) 2 (bsBin (==))
153 Prim (UN "prim__eqString") (ty [StrType, StrType] IType) 2 (bsBin (==))
148− ([E.name "x", E.name "y"], strEq (fun "x") (fun "y")) total,
154+ ([E.name "x", E.name "y"], strEq (fun "x") (fun "y"))
155+ ([sString, sString], sInt, EqS) total,
149 Prim (UN "prim__ltString") (ty [StrType, StrType] IType) 2 (bsBin (<))
156 Prim (UN "prim__ltString") (ty [StrType, StrType] IType) 2 (bsBin (<))
150− ([E.name "x", E.name "y"], strLt (fun "x") (fun "y")) total,
157+ ([E.name "x", E.name "y"], strLt (fun "x") (fun "y"))
158+ ([sString, sString], sInt, LtS) total,
151 -- Conversions
159 -- Conversions
152 Prim (UN "prim__strToInt") (ty [StrType] IType) 1 (c_strToInt)
160 Prim (UN "prim__strToInt") (ty [StrType] IType) 1 (c_strToInt)
153− ([E.name "x"], strToInt (fun "x")) total,
161+ ([E.name "x"], strToInt (fun "x")) ([sString], sInt, StoI) total,
154 Prim (UN "prim__intToStr") (ty [IType] StrType) 1 (c_intToStr)
162 Prim (UN "prim__intToStr") (ty [IType] StrType) 1 (c_intToStr)
155− ([E.name "x"], intToStr (fun "x")) total,
163+ ([E.name "x"], intToStr (fun "x")) ([sInt], sString, ItoS) total,
156 Prim (UN "prim__charToInt") (ty [ChType] IType) 1 (c_charToInt)
164 Prim (UN "prim__charToInt") (ty [ChType] IType) 1 (c_charToInt)
157− ([E.name "x"], charToInt (fun "x")) total,
165+ ([E.name "x"], charToInt (fun "x")) ([sChar], sInt, CtoI) total,
158 Prim (UN "prim__intToChar") (ty [IType] ChType) 1 (c_intToChar)
166 Prim (UN "prim__intToChar") (ty [IType] ChType) 1 (c_intToChar)
159− ([E.name "x"], intToChar (fun "x")) total,
167+ ([E.name "x"], intToChar (fun "x")) ([sInt], sChar, ItoC) total,
160 Prim (UN "prim__intToBigInt") (ty [IType] BIType) 1 (c_intToBigInt)
168 Prim (UN "prim__intToBigInt") (ty [IType] BIType) 1 (c_intToBigInt)
161− ([E.name "x"], intToBigInt (fun "x")) total,
169+ ([E.name "x"], intToBigInt (fun "x")) ([sInt], sBigInt, ItoBI) total,
162 Prim (UN "prim__bigIntToInt") (ty [BIType] IType) 1 (c_bigIntToInt)
170 Prim (UN "prim__bigIntToInt") (ty [BIType] IType) 1 (c_bigIntToInt)
163− ([E.name "x"], bigIntToInt (fun "x")) total,
171+ ([E.name "x"], bigIntToInt (fun "x")) ([sBigInt], sInt, BItoI) total,
164 Prim (UN "prim__strToBigInt") (ty [StrType] BIType) 1 (c_strToBigInt)
172 Prim (UN "prim__strToBigInt") (ty [StrType] BIType) 1 (c_strToBigInt)
165− ([E.name "x"], strToBigInt (fun "x")) total,
173+ ([E.name "x"], strToBigInt (fun "x")) ([sString], sBigInt, StoBI) total,
166 Prim (UN "prim__bigIntToStr") (ty [BIType] StrType) 1 (c_bigIntToStr)
174 Prim (UN "prim__bigIntToStr") (ty [BIType] StrType) 1 (c_bigIntToStr)
167− ([E.name "x"], bigIntToStr (fun "x")) total,
175+ ([E.name "x"], bigIntToStr (fun "x")) ([sBigInt], sString, BItoS) total,
168 Prim (UN "prim__strToFloat") (ty [StrType] FlType) 1 (c_strToFloat)
176 Prim (UN "prim__strToFloat") (ty [StrType] FlType) 1 (c_strToFloat)
169− ([E.name "x"], strToFloat (fun "x")) total,
177+ ([E.name "x"], strToFloat (fun "x")) ([sString], sFloat, StoF) total,
170 Prim (UN "prim__floatToStr") (ty [FlType] StrType) 1 (c_floatToStr)
178 Prim (UN "prim__floatToStr") (ty [FlType] StrType) 1 (c_floatToStr)
171− ([E.name "x"], floatToStr (fun "x")) total,
179+ ([E.name "x"], floatToStr (fun "x")) ([sFloat], sString, FtoS) total,
172 Prim (UN "prim__intToFloat") (ty [IType] FlType) 1 (c_intToFloat)
180 Prim (UN "prim__intToFloat") (ty [IType] FlType) 1 (c_intToFloat)
173− ([E.name "x"], intToFloat (fun "x")) total,
181+ ([E.name "x"], intToFloat (fun "x")) ([sInt], sFloat, ItoF) total,
174 Prim (UN "prim__floatToInt") (ty [FlType] IType) 1 (c_floatToInt)
182 Prim (UN "prim__floatToInt") (ty [FlType] IType) 1 (c_floatToInt)
175− ([E.name "x"], floatToInt (fun "x")) total,
183+ ([E.name "x"], floatToInt (fun "x")) ([sFloat], sInt, FtoI) total,
177 Prim (UN "prim__floatExp") (ty [FlType] FlType) 1 (p_floatExp)
185 Prim (UN "prim__floatExp") (ty [FlType] FlType) 1 (p_floatExp)
178− ([E.name "x"], floatExp (fun "x")) total,
186+ ([E.name "x"], floatExp (fun "x")) ([sFloat], sFloat, ExpF) total,
179 Prim (UN "prim__floatLog") (ty [FlType] FlType) 1 (p_floatLog)
187 Prim (UN "prim__floatLog") (ty [FlType] FlType) 1 (p_floatLog)
180− ([E.name "x"], floatLog (fun "x")) total,
188+ ([E.name "x"], floatLog (fun "x")) ([sFloat], sFloat, LogF) total,
181 Prim (UN "prim__floatSin") (ty [FlType] FlType) 1 (p_floatSin)
189 Prim (UN "prim__floatSin") (ty [FlType] FlType) 1 (p_floatSin)
182− ([E.name "x"], floatSin (fun "x")) total,
190+ ([E.name "x"], floatSin (fun "x")) ([sFloat], sFloat, SinF) total,
183 Prim (UN "prim__floatCos") (ty [FlType] FlType) 1 (p_floatCos)
191 Prim (UN "prim__floatCos") (ty [FlType] FlType) 1 (p_floatCos)
184− ([E.name "x"], floatCos (fun "x")) total,
192+ ([E.name "x"], floatCos (fun "x")) ([sFloat], sFloat, CosF) total,
185 Prim (UN "prim__floatTan") (ty [FlType] FlType) 1 (p_floatTan)
193 Prim (UN "prim__floatTan") (ty [FlType] FlType) 1 (p_floatTan)
186− ([E.name "x"], floatTan (fun "x")) total,
194+ ([E.name "x"], floatTan (fun "x")) ([sFloat], sFloat, TanF) total,
187 Prim (UN "prim__floatASin") (ty [FlType] FlType) 1 (p_floatASin)
195 Prim (UN "prim__floatASin") (ty [FlType] FlType) 1 (p_floatASin)
188− ([E.name "x"], floatASin (fun "x")) total,
196+ ([E.name "x"], floatASin (fun "x")) ([sFloat], sFloat, ASinF) total,
189 Prim (UN "prim__floatACos") (ty [FlType] FlType) 1 (p_floatACos)
197 Prim (UN "prim__floatACos") (ty [FlType] FlType) 1 (p_floatACos)
190− ([E.name "x"], floatACos (fun "x")) total,
198+ ([E.name "x"], floatACos (fun "x")) ([sFloat], sFloat, ACosF) total,
191 Prim (UN "prim__floatATan") (ty [FlType] FlType) 1 (p_floatATan)
199 Prim (UN "prim__floatATan") (ty [FlType] FlType) 1 (p_floatATan)
192− ([E.name "x"], floatATan (fun "x")) total,
200+ ([E.name "x"], floatATan (fun "x")) ([sFloat], sFloat, ATanF) total,
193 Prim (UN "prim__floatSqrt") (ty [FlType] FlType) 1 (p_floatSqrt)
201 Prim (UN "prim__floatSqrt") (ty [FlType] FlType) 1 (p_floatSqrt)
194− ([E.name "x"], floatSqrt (fun "x")) total,
202+ ([E.name "x"], floatSqrt (fun "x")) ([sFloat], sFloat, SqrtF) total,
195 Prim (UN "prim__floatFloor") (ty [FlType] FlType) 1 (p_floatFloor)
203 Prim (UN "prim__floatFloor") (ty [FlType] FlType) 1 (p_floatFloor)
196− ([E.name "x"], floatFloor (fun "x")) total,
204+ ([E.name "x"], floatFloor (fun "x")) ([sFloat], sFloat, FloorF) total,
197 Prim (UN "prim__floatCeil") (ty [FlType] FlType) 1 (p_floatCeil)
205 Prim (UN "prim__floatCeil") (ty [FlType] FlType) 1 (p_floatCeil)
198− ([E.name "x"], floatCeil (fun "x")) total,
206+ ([E.name "x"], floatCeil (fun "x")) ([sFloat], sFloat, CeilF) total,
200 Prim (UN "prim__strHead") (ty [StrType] ChType) 1 (p_strHead)
208 Prim (UN "prim__strHead") (ty [StrType] ChType) 1 (p_strHead)
201− ([E.name "x"], strHead (fun "x")) partial,
209+ ([E.name "x"], strHead (fun "x")) ([sString], sChar, HeadS) partial,
202 Prim (UN "prim__strTail") (ty [StrType] StrType) 1 (p_strTail)
210 Prim (UN "prim__strTail") (ty [StrType] StrType) 1 (p_strTail)
203− ([E.name "x"], strTail (fun "x")) partial,
211+ ([E.name "x"], strTail (fun "x")) ([sString], sString, TailS) partial,
204 Prim (UN "prim__strCons") (ty [ChType, StrType] StrType) 2 (p_strCons)
212 Prim (UN "prim__strCons") (ty [ChType, StrType] StrType) 2 (p_strCons)
205− ([E.name "x", E.name "xs"], strCons (fun "x") (fun "xs")) total,
213+ ([E.name "x", E.name "xs"], strCons (fun "x") (fun "xs"))
214+ ([sChar, sString], sString, ConsS) total,
206 Prim (UN "prim__strIndex") (ty [StrType, IType] ChType) 2 (p_strIndex)
215 Prim (UN "prim__strIndex") (ty [StrType, IType] ChType) 2 (p_strIndex)
207− ([E.name "x", E.name "i"], strIndex (fun "x") (fun "i")) partial,
216+ ([E.name "x", E.name "i"], strIndex (fun "x") (fun "i"))
217+ ([sString, sInt], sChar, IndexS) partial,
208 Prim (UN "prim__strRev") (ty [StrType] StrType) 1 (p_strRev)
218 Prim (UN "prim__strRev") (ty [StrType] StrType) 1 (p_strRev)
209− ([E.name "x"], strRev (fun "x")) total,
219+ ([E.name "x"], strRev (fun "x"))
220+ ([sString], sString, RevS) total,
211 Prim (UN "prim__believe_me") believeTy 3 (p_believeMe)
222 Prim (UN "prim__believe_me") believeTy 3 (p_believeMe)
212− ([E.name "a", E.name "b", E.name "x"], fun "x") total -- ahem
223+ ([E.name "a", E.name "b", E.name "x"], fun "x")
224+ ([Nothing], Nothing, BelieveMe) total -- ahem
215p_believeMe [_,_,x] = Just x
227p_believeMe [_,_,x] = Just x
@@ -311,11 +323,12 @@ p_strRev [VConstant (Str xs)] = Just $ VConstant (Str (reverse xs))
311p_strRev _ = Nothing
323p_strRev _ = Nothing
313elabPrim :: Prim -> Idris ()
325elabPrim :: Prim -> Idris ()
314−elabPrim (Prim n ty i def epic tot)
326+elabPrim (Prim n ty i def epic sc tot)
315 = do updateContext (addOperator n ty i def)
327 = do updateContext (addOperator n ty i def)
316 setTotality n tot
328 setTotality n tot
317 i <- getIState
329 i <- getIState
318− putIState i { idris_prims = (n, epic) : idris_prims i }
330+ putIState i { idris_prims = (n, epic) : idris_prims i,
331+ idris_scprims = (n, sc) : idris_scprims i }
320elabPrims :: Idris ()
333elabPrims :: Idris ()
321elabPrims = do mapM_ (elabDecl toplevel)
334elabPrims = do mapM_ (elabDecl toplevel)