+ on Int is extremely cheap. It is always faster to add again rather
than store the value.
But Integer is a different story. Addition time on this type can grow to
several minutes.
18.02.2012 13:28, Heinrich Hördegen пишет:
Dear all,
I have a question about evaluation with respect to types
example = a + b + a + b
exampleCSE = x + x
where x = a + b
With CSE we are introducing new thunk: x.
18.02.2012 17:38, Roman Cheplyaka пишет:
* Holger Siegelholgersiege...@yahoo.de [2012-02-18 12:52:08+0100]
You cannot. Common subexpression elimination is done by GHC very
conservatively,
02.10.2011 19:55, David Barbour пишет:
Use TypeFamilies.
{-# LANGUAGE TypeFamilies #}
...
type family FType a :: *
type instance FType Char = Float
type instance FType Double = Int
class ExampleClass a where
f :: a - FType a
Better to include type in class.
class ExampleClass a where
type
read :: String - [[Double]] can't read this format. It expects
[[0,30,9],[0.1,30,9],...]
use this code
let m = map f text :: [[Double]]
f a = map g $ lines a
g a = map read $ words a
15.06.2011 15:13, kaffeepause73 пишет:
Dear all,
I want to read numeric data in vector / matrix