Commit e0efcd2b authored by John van Groningen's avatar John van Groningen

add gDefault instance for RECORD and export gDefault instance for UNIT

parent b9a5e4ff
......@@ -4,7 +4,6 @@ import StdGeneric
generic gDefault a :: a
derive gDefault Int, Real, String, PAIR, EITHER, CONS, FIELD, OBJECT
derive gDefault Int, Real, String, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, RECORD
derive gDefault [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
implementation module GenDefault
//import StdClass, StdArray, StdInt, StdFunc
import StdGeneric
generic gDefault a :: a
gDefault{|Int|} = 0
gDefault{|Real|} = 0.0
gDefault{|String|} = ""
gDefault{|UNIT|} = UNIT
generic gDefault a :: a
gDefault{|Int|} = 0
gDefault{|Real|} = 0.0
gDefault{|String|} = ""
gDefault{|UNIT|} = UNIT
gDefault{|EITHER|} dl dr = RIGHT dr
gDefault{|EITHER|} dl dr = LEFT dl
gDefault{|PAIR|} dl dr = PAIR dl dr
gDefault{|CONS|} dc = CONS dc
gDefault{|FIELD|} df = FIELD df
gDefault{|OBJECT|} do = OBJECT do
gDefault{|RECORD|} dr = RECORD dr
derive gDefault [], (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment