Commit d3192ff9 authored by Erin van der Veen's avatar Erin van der Veen

Derive gHash for EUR, USD and URL

parent 9cfbefb7
Pipeline #47296 failed with stages
in 3 minutes and 8 seconds
definition module iTasks.Extensions.Currency
import iTasks
from iTasks.Internal.Generic.Hash import generic gHash
//* Money (ISO4217 currency codes are used)
:: EUR = EUR !Int //Euros (amount in cents)
......@@ -18,4 +20,5 @@ derive JSONDecode EUR, USD
derive gDefault EUR, USD
derive gEq EUR, USD
derive gText EUR, USD
derive gEditor EUR, USD
derive gEditor EUR, USD
derive gHash EUR, USD
implementation module iTasks.Extensions.Currency
import iTasks
import iTasks.UI.Editor.Controls, iTasks.UI.Editor.Modifiers
from iTasks.Internal.Generic.Hash import generic gHash
import Text, Data.Maybe, Data.Func, Data.Functor
import qualified Data.Map as DM
......@@ -87,5 +88,6 @@ derive JSONEncode EUR, USD
derive JSONDecode EUR, USD
derive gDefault EUR, USD
derive gEq EUR, USD
derive gHash EUR, USD
decFormat x = toString (x / 100) +++ "." +++ lpad (toString (x rem 100)) 2 '0'
definition module iTasks.Extensions.Web
import iTasks
from iTasks.Internal.Generic.Hash import generic gHash
from Internet.HTTP import :: HTTPMethod, :: HTTPRequest, :: HTTPResponse
from Text.URI import :: URI
from Text.HTML import class html
......@@ -20,6 +21,7 @@ derive JSONEncode URL
derive JSONDecode URL
derive gDefault URL
derive gEq URL
derive gHash URL
//* Simple web server task
serveWebService :: Int (HTTPRequest -> Task HTTPResponse) -> Task ()
......
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