Getting <<loop>> Exception in Haskell Depending on Pattern Arrangement -


someone can please explain why getting loop in code?

module main  import data.list.split import data.maybe import text.read  main :: io () main = print (snd (toinmetdate "01/02/2012"))  type p = (bool, a)  readp :: (read a) => string -> p readp text   | isjust value    = (true, fromjust value)   | isnothing value = (false, read "0")   value = readmaybe text  data inmetdate = inmetdate {dia :: p int, mes :: p int, ano :: p integer}   deriving (show, read)  toinmetdate :: string -> p inmetdate toinmetdate x = if length l == 3    (true, inmetdate (readp ds) (readp ms) (readp as))   else  (false, inmetdate (false, 0) (false, 0) (false, 0))   (l,ds:ms:as:_) = (spliton "/" x, l ++ replicate 20 "null") 

i state that, when make:

  (l,ds:ms:as:_) = (spliton "/" x, l ++ replicate 20 "null") 

equal to:

  (ds:ms:as:_) = l ++ replicate 20 "null"         l = spliton "/" x 

the code work perfectly.

in original, value of l depends on tuple recursively defined in terms of l. in change, l depends solely on value of spliton "/" x.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -