You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{-# LANGUAGE DeriveDataTypeable -}
module Main where
import Data.Ratio
import System.Console.CmdArgs
data Options = Options { r :: Ratio Int
} deriving (Show, Data, Typeable)
defaultOptions = Options { r = 4 % 7 }
main = print =<< cmdArgs defaultOptions
The error message is:
Data.Generics.Any: Undefined field inside compose0, :% :: Ratio Int
The text was updated successfully, but these errors were encountered:
The problem is that Ratio is defined with strict fields, specifically:
data Ratio a = !a :% !a deriving (Eq)
And that plays havoc with certain types of Data operations. Fortunately, I was able to fix it up relatively easily in this instance. I've released 0.10.13 with the fix.
While it's fixed, I didn't really expect people to pass Ratio on the command line, and it might not be as useful as you would hope.
CHANGES:
0.10.13
#24, support Ratio in some places
ndmitchell/cmdargs#24
0.10.12
GHC 7.2 compatibility
0.10.11
#15, never put [brackets] around optional args in Explicit
ndmitchell/cmdargs#15
Getting a runtime error on:
The error message is:
Data.Generics.Any: Undefined field inside compose0, :% :: Ratio Int
The text was updated successfully, but these errors were encountered: