Ben Millwood wrote:
In general, laziness behaviour can
get complicated quickly and so I'm not convinced that the type
signature is a good home for that information.
Certainly it can. A lot of the same problems arise in the logic
programming community under the topic of modes, i.e. whether a
On Sat, Mar 13, 2010 at 3:19 AM, wren ng thornton w...@freegeek.org wrote:
The usual approach I've seen is not to distinguish strict and lazy
datatypes, but rather to distinguish strict and lazy functions, e.g. by
having two different arrows: (-) for lazy functions and (!-) for strict
Note that foldl' has a ' to indicate that it's not the same as foldl
exactly. I would propose that sum' exist as well as sum, and that sum be
lazy.
Well, meaningful identifier names is nice, but I think
here we have a case of the code smell type info embedded in the name.
Strictness of a
On Fri, Mar 12, 2010 at 10:29 AM, Johannes Waldmann
waldm...@imn.htwk-leipzig.de wrote:
Well, meaningful identifier names is nice, but I think
here we have a case of the code smell type info embedded in the name.
Strictness of a function should be expressed in the function's type instead.
But
Johannes Waldmann waldm...@imn.htwk-leipzig.de writes:
Well, meaningful identifier names is nice, but I think
here we have a case of the code smell type info embedded in the name.
Strictness of a function should be expressed in the function's type instead.
I've stumbled into this sentiment
David Virebayre dav.vire+haskell at gmail.com writes:
Even if we had a syntax to express that the function is strict,
wouldn't we still need two distinct function names for the strict and
lazy case ?
OK, I'd like to register a code smell for:
hierarchical/systematic structure inside
Ketil Malde ketil at malde.org writes:
Prelude Data.List :t foldl
foldl :: (a - b - a) - a - [b] - a
What should the type look like?
Good question - and in my posting I tried to avoid the impression
that I have an answer, because I really haven't.
My suggestion was that some of the
wren I wish Haskell allowed ! to occur (non-initially) in alphanum_'
wren identifiers as well as in symbolic ones. Then we could be more
wren consistent about having ! mean strictness
BTW, does something in haskell syntax prevent '?' from appearing at the
end of identifiers ? It is a nice way to
Am Freitag 12 März 2010 12:14:06 schrieb Paul R:
wren I wish Haskell allowed ! to occur (non-initially) in alphanum_'
wren identifiers as well as in symbolic ones. Then we could be more
wren consistent about having ! mean strictness
BTW, does something in haskell syntax prevent '?' from
On Fri, Mar 12, 2010 at 12:01 PM, Johannes Waldmann
waldm...@imn.htwk-leipzig.de wrote:
David Virebayre dav.vire+haskell at gmail.com writes:
in this case, something like: Data.List.Strict.fold, Data.List.Lazy.fold
But then if you need both version, you will have to import them
qualified,
David Virebayre dav.vire+haskell at gmail.com writes:
But then if you need both version, you will have to import them
qualified, which I don't like much.
solution: type directed name resolution:
* either in the language,
On Fri, 12 Mar 2010, Johannes Waldmann wrote:
Ketil Malde ketil at malde.org writes:
Prelude Data.List :t foldl
foldl :: (a - b - a) - a - [b] - a
What should the type look like?
Good question - and in my posting I tried to avoid the impression
that I have an answer, because I really
On 12 March 2010 10:38, Ketil Malde ke...@malde.org wrote:
What should the type look like? If memory serves, Clean allows bangs in
type signatures, something like:
foldl' :: (a - b - a) - !a - [b] - a
but I thought it just added a seq under the hood,
Thats my understanding too.
I did
On Mar 12, 2010, at 06:01 , Johannes Waldmann wrote:
in this case, something like: Data.List.Strict.fold,
Data.List.Lazy.fold
Or - if we had static overloading, and strictness info in the type,
then we wouldn't need different names. Can of worms ...
Doesn't help if strictness needs to be
Ketil Malde wrote:
What should the type look like? If memory serves, Clean allows bangs in
type signatures, something like:
foldl' :: (a - b - a) - !a - [b] - a
but I thought it just added a seq under the hood, much like bang
patterns like
foldl' f !z xs = ...
do in Haskell, so it's
15 matches
Mail list logo