Commit 249b55d1 authored by Steffen Michels's avatar Steffen Michels

move gDefault/gFiniteDefault instance of Dynamic to Data.Dynamic

parent 0176e5e4
Pipeline #14194 passed with stage
in 1 minute and 9 seconds
definition module Data.Dynamic
from Data.Maybe import :: Maybe
from Data.GenDefault import generic gDefault, generic gFiniteDefault
derive gDefault Dynamic
derive gFiniteDefault Dynamic
implementation module Data.Dynamic
import Data.GenDefault
gDefault{|Dynamic|} = dynamic ()
gFiniteDefault{|Dynamic|} = [Just (dynamic ())]
......@@ -10,7 +10,7 @@ from Data.Maybe import :: Maybe(Just)
* @result A default value
*/
generic gDefault a :: a
derive gDefault Bool, Char, Int, Real, String, (->), Dynamic, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, RECORD
derive gDefault Bool, Char, Int, Real, String, (->), UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, RECORD
derive gDefault [], [!], [ !], [!!], {}, {!}
derive gDefault (), (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
......@@ -31,6 +31,6 @@ finiteDefaultValue :== hd [d \\ Just d <- gFiniteDefault{|*|}]
* @result The list of optional values with the properties given above
**/
generic gFiniteDefault a :: [Maybe a]
derive gFiniteDefault Bool, Char, Int, Real, String, (->), Dynamic, UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, RECORD
derive gFiniteDefault Bool, Char, Int, Real, String, (->), UNIT, PAIR, EITHER, CONS, FIELD, OBJECT, RECORD
derive gFiniteDefault [], [!], [ !], [!!], {}, {!}
derive gFiniteDefault (), (,), (,,), (,,,), (,,,,), (,,,,,), (,,,,,,), (,,,,,,,)
......@@ -10,7 +10,6 @@ gDefault{|String|} = ""
gDefault{|Bool|} = False
gDefault{|Char|} = '-'
gDefault{|(->)|} _ fb = const fb
gDefault{|Dynamic|} = dynamic ()
gDefault{|[]|} _ = []
gDefault{|[!]|} _ = [!]
gDefault{|[ !]|} _ = [ !]
......@@ -35,7 +34,6 @@ gFiniteDefault{|String|} = [Just ""]
gFiniteDefault{|Bool|} = [Just False]
gFiniteDefault{|Char|} = [Just '-']
gFiniteDefault{|(->)|} _ fb = fmap const <$> fb
gFiniteDefault{|Dynamic|} = [Just (dynamic ())]
gFiniteDefault{|[]|} _ = [Just []]
gFiniteDefault{|[!]|} _ = [Just [!]]
gFiniteDefault{|[ !]|} _ = [Just [ !]]
......
......@@ -53,6 +53,7 @@ import qualified Data.Bifunctor
import qualified Data.CircularStack
import qualified Data.Complex
import qualified Data.Data
import qualified Data.Dynamic
import qualified Data.Either
import qualified Data.Encoding.RunLength
import qualified Data.Eq
......
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