On 25 June 2012 12:50, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
There was another mail, but the subject might be confusing. So I
write this one. The code is here: http://hpaste.org/70414
If I understand correct, generally, I could use 'type' to do alias
to save the
Here is the code, I joined two modules in one paste. Both of them
cannot pass compiling.
http://hpaste.org/70418
On Mon, Jun 25, 2012 at 2:16 PM, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.com wrote:
On 25 June 2012 12:50, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Hi,
Magicloud,
Try to reduce the particular problem you're having to the smallest possible
example that reproduces the issue. None of us can compile your code, either,
because we're missing many of the dependencies, and unfortunately the issue is
no easier (for me) to track down with the full
On 25 June 2012 19:04, Arlen Cuss a...@len.me wrote:
Magicloud,
Try to reduce the particular problem you're having to the smallest possible
example that reproduces the issue. None of us can compile your code, either,
because we're missing many of the dependencies, and unfortunately the
Sorry, I forgot that. Magicloud.Map.mapM sure is a helper I use as
lifted Data.Map.map.
If I changed the type of the result of start, the Jobs module
compiled. But still cannot compile with the other module (which uses
start). And the error is on JobArgs.
I post the function here, I am not sure
Interesting, seems like mapM did not effect the problem
Let me try more with the first argument of mapM
On Mon, Jun 25, 2012 at 5:04 PM, Arlen Cuss a...@len.me wrote:
Magicloud,
Try to reduce the particular problem you're having to the smallest possible
example that reproduces the
Even more weird, I installed container-0.5.0.0, and now it just compiled!
I will dig more of that. Sorry to bother you guys.
On Mon, Jun 25, 2012 at 5:53 PM, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Interesting, seems like mapM did not effect the problem
Let me try more
Glad you worked it out! :) Usually isolating the part of concern in a
mysterious error will help shed light on the source!
Cheers,
Arlen
On Monday, 25 June 2012 at 8:00 PM, Magicloud Magiclouds wrote:
Even more weird, I installed container-0.5.0.0, and now it just compiled!
I will dig
On 25 June 2012 20:00, Magicloud Magiclouds
magicloud.magiclo...@gmail.com wrote:
Even more weird, I installed container-0.5.0.0, and now it just compiled!
I will dig more of that. Sorry to bother you guys.
Possibly your Magiclouds module was using a different version of
containers or
Hi,
There was another mail, but the subject might be confusing. So I
write this one. The code is here: http://hpaste.org/70414
If I understand correct, generally, I could use 'type' to do alias
to save the ugly-long code. Like section 1. This works when I 't [(0,
Just x)]'.
But, if I wrote
On 18 October 2011 02:17, bob zhang bobzhang1...@gmail.com wrote:
But I found a problem which I thought would be made better, plz correct
me if I am wrong
For those who only subscribe to Haskell-Cafe, Bob posted a very
similar thread to ghc-users, which I replied to here with a suggestion
Hi cafe,
I have played quite a bit with the ConstraintKinds extension, pretty
cool.
But I found a problem which I thought would be made better, plz correct
me if I am wrong
take a contrived example,
class C B = B a where
here B :: * - Constraint, I think this definition
A continuation.
You can't know, what type your fromInt n should be, but you're not going to just leave it anyway, you're gonna do some calculations with it, resulting in something of type r. So, your calculation is
gonna be of type (forall n. Nat n = n - r). So, if you imagine for a moment
Thanks a lot for the explanation. Summarizing: You can't calculate an
exact type, but you don't care if the type of the continuation is
properly set in order to hide the exact type of n? Am I right?
Arnaud
On Fri, Nov 19, 2010 at 9:24 AM, Miguel Mitrofanov
miguelim...@yandex.ru wrote:
A
The obvious way to write the result would be (stealing some syntax made up
by ski on #haskell):
fromInt :: Int - (exists n. (Nat n) * n)
fromInt = ...
meaning, at compile time we don't know the type of the result of fromInt,
because it depends on a runtime value, but we'll tell you it's _some_
Yes it helps, although I am no type wizard!
Thanks a lot for these insights, it gives me some more ideas.
Best regards
Arnaud
On Fri, Nov 19, 2010 at 5:55 PM, Daniel Peebles pumpkin...@gmail.com wrote:
The obvious way to write the result would be (stealing some syntax made up
by ski on
Hello,
I am trying to understand and use the Nat n type defined in the
aforementioned article. Unfortunately, the given code does not compile
properly:
Here is the code:
module Naturals where
data Zero
data Succ a
class Nat n where
toInt :: n - Int
instance Nat Zero where
toInt _ = 0
On Thu, Nov 18, 2010 at 20:17, Arnaud Bailly arnaud.oq...@gmail.com wrote:
Hello,
I am trying to understand and use the Nat n type defined in the
aforementioned article. Unfortunately, the given code does not compile
properly:
[snip]
instance (Nat n) = Nat (Succ n) where
toInt _ = 1 +
Thanks a lot, that works perfectly fine!
Did not know this one...
BTW, I would be interested in the fromInt too.
Arnaud
On Thu, Nov 18, 2010 at 8:22 PM, Erik Hesselink hessel...@gmail.com wrote:
On Thu, Nov 18, 2010 at 20:17, Arnaud Bailly arnaud.oq...@gmail.com wrote:
Hello,
I am trying to
The best you can do with fromInt is something like Int - (forall n. (Nat n)
= n - r) - r, since the type isn't known at compile time.
On Thu, Nov 18, 2010 at 2:52 PM, Arnaud Bailly arnaud.oq...@gmail.comwrote:
Thanks a lot, that works perfectly fine!
Did not know this one...
BTW, I would be
Just after hitting the button send, it appeared to me that fromInt was
not obvious at all, and probably impossible.
Not sure I understand your answer though: What would be the second
parameter (forall n . (Nat n) = n - r) - r) ?
Thanks
Arnaud
On Fri, Nov 19, 2010 at 1:07 AM, Daniel Peebles
thanks for all suggestions.
zaxis wrote:
For me i like C style instead of layout. For example,
func1 a = do
-- ...
a * 2
-- ...
I always write it as:
func1 a = do {
-- ...;
a * 2;
-- ...;
}
However, i donot know how to write pure function using C style.
fac n = let {
f = foldr (*) 1 [1..n]
} in f
:D
sorry for double reply, need to cc cafe, this is fun.
On Tue, Feb 2, 2010 at 4:33 PM, zaxis z_a...@163.com wrote:
thanks for all suggestions.
zaxis wrote:
For me i like C style instead of layout. For example,
func1 a = do
-- ...
From: haskell-cafe-boun...@haskell.org
[mailto:haskell-cafe-boun...@haskell.org] On Behalf Of zaxis
For me i like C style instead of layout. For example,
func1 a = do {
-- ...;
a * 2;
-- ...;
}
The report has all the gory details. The brace+semicolon syntax isn't
just
fac n = let { f = foldr (*) 1 [1..n] } in f
VERY interesting :)
Jinjing Wang wrote:
fac n = let {
f = foldr (*) 1 [1..n]
} in f
:D
sorry for double reply, need to cc cafe, this is fun.
On Tue, Feb 2, 2010 at 4:33 PM, zaxis z_a...@163.com wrote:
thanks for all suggestions.
For me i like C style instead of layout. For example,
func1 a = do
-- ...
a * 2
-- ...
I always write it as:
func1 a = do {
-- ...;
a * 2;
-- ...;
}
However, i donot know how to write pure function using C style.
func1 a = {
-- ...;
a * 2;
-- ...;
}
will not
zaxis z_a...@163.com writes:
However, i donot know how to write pure function using C style.
func1 a = {
-- ...;
a * 2;
-- ...;
}
You mean imperatively? Short answer: you can't and you shouldn't.
Slightly longer answer: you can possibly fudge something together using
the Identity
zaxis wrote:
For me i like C style instead of layout. For example,
func1 a = do
-- ...
a * 2
-- ...
I always write it as:
func1 a = do {
-- ...;
a * 2;
-- ...;
}
Honestly, don't do this.
When you're coding in Haskell you should write idiomatic Haskell and
However, i donot know how to write pure function using C style.
func1 a = {
-- ...;
a * 2;
-- ...;
}
What do you mean by a * 2? If you don't use this value, don't
calculate it.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
Ditto what everyone else has said. But to clarify what's going on:
The braces are used to introduce a list of things, such as monadic actions,
data fields, or declarations. For example, consider the following code:
f a =
let {
a_times_2 = a*2;
a_times_4 = a*4;
} in
2009/11/16 zaxis z_a...@163.com:
%uname -a
Linux myarch 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:48:17 CET 2009 i686
AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ AuthenticAMD GNU/Linux
%xmonad --version
xmonad 0.9
In firefox, the `save as` dialog doesnot appear when i want to choose
I have subscribed to xmonad maillist but i never received any email !
Deniz Dogan-3 wrote:
2009/11/16 zaxis z_a...@163.com:
%uname -a
Linux myarch 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:48:17 CET 2009 i686
AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ AuthenticAMD GNU/Linux
%xmonad
%uname -a
Linux myarch 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:48:17 CET 2009 i686
AMD Athlon(tm) 64 X2 Dual Core Processor 3600+ AuthenticAMD GNU/Linux
%xmonad --version
xmonad 0.9
In firefox, the `save as` dialog doesnot appear when i want to choose
picture to save by right clicking the
Hi, I am trying to get the function showMinProp to return String, but I
always get an error of parse error (possibly incorrect indentation)
Who can help with this? any idea?
Thank u in advance!
data Prop
= Var String
| Negation Prop
| BinOp Op Prop Prop
data Op = And | Or | Implies | Equiv
Am Freitag 18 September 2009 02:17:22 schrieb xu zhang:
showMinProp :: Int - Prop - String
showMinProp preNo (BinOp op p q) =
case op of
And - let a = 4
Or - let a = 3
Implies - let a = 2
Equiv - let a = 1
if (a preNo)
then
On Sep 17, 2009, at 20:17 , xu zhang wrote:
case op of
And - let a = 4
Or - let a = 3
Implies - let a = 2
Equiv - let a = 1
let isn't an assignment command, it's a scoping command. That is,
let a = 3 in ...
is equivalent to something like
{
Hi there,
If I import a module and do not explicitly point out the entities I have
imported. And I want the ghc to point out the entities automatically. Is
there any method to do this? any methods to have the ghc point out the
entities I import and export?
Because there are so many files and I
2009/8/5 xu zhang douy...@gmail.com:
Hi there,
If I import a module and do not explicitly point out the entities I have
imported. And I want the ghc to point out the entities automatically. Is
there any method to do this? any methods to have the ghc point out the
entities I import and
On Thu, Jul 09, 2009 at 10:57:19AM -0400, xu zhang wrote:
I have trouble in returning a list of Figures. I want return a type of m
(Maybe [Figure IO]), but the type of dv_findFigure is :: a - Point - s
(Maybe (Figure s)). How can change the code below to get a s (Maybe [Figure
s])?
Thank you
_
Messenger安全保护中心,免费修复系统漏洞,保护Messenger安全!
http://im.live.cn/safe/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
I have trouble in returning a list of Figures. I want return a type of m
(Maybe [Figure IO]), but the type of dv_findFigure is :: a - Point - s
(Maybe (Figure s)). How can change the code below to get a s (Maybe [Figure
s])?
Thank you in advance!
dv_findFigure :: a - Point - s (Maybe (Figures))
On Jun 17, 2009, at 11:54 , .shawn wrote:
mapTreeM action (Leaf a) = do
lift (putStrLn (Leaf ++ show a))
b - action a
return (Leaf b)
mapTreeM :: (MonadTrans t, Monad (t IO), Show a) = (a - t IO a1) -
Tree a - t IO (Tree a1)
Why does the type signature of mapTreeM look like
On page 141 of Yet another Haskell Tutorial (9.7 Monad Transformers)
mapTreeM action (Leaf a) = do
lift (putStrLn (Leaf ++ show a))
b - action a
return (Leaf b)
mapTreeM :: (MonadTrans t, Monad (t IO), Show a) = (a - t IO a1) - Tree a -
t IO (Tree a1)
Why does the type signature
On 17 Jun 2009, at 19:54, .shawn wrote:
Why does the type signature of mapTreeM look like this?
Why not? I can't think of any other possibility.
And what does it mean by The lift tell us that we're going to be
executing a command in an enclosed monad. In this case the enclosed
monad is
.shawn wrote:
On page 141 of Yet another Haskell Tutorial (9.7 Monad Transformers)
mapTreeM action (Leaf a) = do
lift (putStrLn (Leaf ++ show a))
b - action a
return (Leaf b)
mapTreeM :: (MonadTrans t, Monad (t IO), Show a) = (a - t IO a1) -
Tree a - t IO (Tree a1)
Why does the type
张旭 stircrazyn...@hotmail.com writes:
Hi, I am really new to haskell. I am reading A gentle instruction
to haskell now. And I just cannot understand the chapter below. Is
there anybody who can gives me some hints about why the pattern
matching for client is so early? How does the pattern
Hi Ryan, thanks for a nice and thorough explanation. I had trouble
understanding the section of the tutorial as well. Maybe it would deserve to
rewrite to something a bit simpler?
Anyhow, I'd like to ask: Is there a reason for which pattern matching for
single-constructor data types isn't lazy by
2009/5/28 Petr Pudlak d...@pudlak.name:
Hi Ryan, thanks for a nice and thorough explanation. I had trouble
understanding the section of the tutorial as well. Maybe it would deserve to
rewrite to something a bit simpler?
Anyhow, I'd like to ask: Is there a reason for which pattern matching for
The main change I would make is to rename the arguments to
client/server; they overload the same names (reqs/resps) as the top
level declarations above, so it's very easy to get confused while
reading it.
Partially, I think this is just a hard concept to understand;
struggling to figure it out
Hello 张旭,
Wednesday, May 27, 2009, 11:51:34 PM, you wrote:
Hi, I am really new to haskell. I am reading A gentle instruction
to haskell now. And I just cannot understand the chapter below. Is
there anybody who can gives me some hints about why the pattern
matching for client is so early?
Hi nemo. I had a lot of trouble with that section of the tutorial as
well, and I believe that once you get it, a lot of Haskell becomes a
lot simpler.
The way I eventually figured it out is using this idealized execution
model for Haskell: you just work by rewriting the left side of a
function
takeListSt' = evalState . foldr k (return []) . map (State . splitAt)
where k m m'= cutNull $ do x-m; xs-m'; return (x:xs)
cutNull m = do s-get; if null s then return [] else m
Not only is ths not that elegant anymore, I think it *still* has a
bug, stack overflow against
takeListSt' = evalState . foldr k (return []) . map (State . splitAt)
where k m m'= cutNull $ do x-m; xs-m'; return (x:xs)
cutNull m = do s-get; if null s then return [] else m
|Not only is ths not that elegant anymore,
As I was saying, sequence/mapM with early cutout is
Hi.
Haskell 98 allows import alias:
import qualified VeryLongModuleName as C
however it does not allow aliasing for imported names
import NormalModule (veryLongFunctionName as C)
what is the rational?
IMHO this can be very useful in some cases.
Thanks Manlio
On Saturday 04 April 2009, Manlio Perillo wrote:
Hi.
Haskell 98 allows import alias:
import qualified VeryLongModuleName as C
however it does not allow aliasing for imported names
import NormalModule (veryLongFunctionName as C)
what is the rational?
IMHO this can be very
Am Samstag 04 April 2009 17:33:55 schrieb Manlio Perillo:
Hi.
Haskell 98 allows import alias:
import qualified VeryLongModuleName as C
however it does not allow aliasing for imported names
import NormalModule (veryLongFunctionName as C)
what is the rational?
IMHO this can be
Hi
You can always do
{-# INLINE short #-}
short =
C.veryLongFunctionNameThatIReallyDoNotWantToTypeOutEveryTimeIUseIt
The INLINE pragma is not necessary, if an optimising compiler fails to
inline that then it's not very good.
However, you might want to consider the (evil) monomorphism
Thanks Claus,
Indeed the problem was that I was using the Strict state monad, with
lazy state it does the right thing when run through testP. I will try
and get back to this thread if I manage the derivation which proves
(or at least supports) that the two versions are equivalent.
2009/4/4
I am reading the book The lambda calculus: Its syntax and Semantics in the
chapter about Godel Numbering but I am confused in some points.
We know for Church Numerals, we have Cn = \fx.f^n(x) for some n=0,
i.e. C0= \fx.x and C
1 = \fx.fx.
From the above definition, I could guess the
John Tromp wrote:
I am reading the book The lambda calculus: Its syntax and Semantics in the
chapter about Godel Numbering but I am confused in some points.
We know for Church Numerals, we have Cn = \fx.f^n(x) for some n=0,
i.e. C0= \fx.x and C
1 = \fx.fx.
From the above definition, I could
Continuing our adventures into stylistic and semantic differences:-)
Can you write this analysis on the wiki?
Hmm, we tried that in the past, and I haven't seen any indication
that people search for those things, let alone find them (one particular
example I recalled I still haven't been able
2009/3/25 wren ng thornton w...@freegeek.org:
Most of the documentation is in research papers, and a normal
programmer don't want to read these papers.
Yes, and no. There is quite a bit of documentation in research papers, and
mainstream programmers don't read research. However, this is a
2009/3/26 Thomas Hartman tphya...@gmail.com:
Beginner list processing code can and often does go awry when presented with
infinite lists.
I didn't mean code that a beginner would write, I mean code that would
be easy to understand for a beginner to read
For that, in this particular example,
Continuing our adventures into stylistic and semantic differences:-)
Comparing the 'State' and explicit recursion versions
takeListSt = evalState . mapM (State . splitAt)
-- ..with a derivation leading to..
takeListSt []s = []
takeListSt (h:t) s = x : takeListSt t s'
* Claus Reinke wrote:
Continuing our adventures into stylistic and semantic differences:-)
It's good practice to keep a simple minded version of the code and using
quickcheck to try to find differences between the optimized and trivial
version. It's good practice to even check, that the
Claus Reinke ha scritto:
Continuing our adventures into stylistic and semantic differences:-)
Can you write this analysis on the wiki?
Thanks!
Manlio
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
I wonder if JHC
or some other compiler might work better with these examples?
Are you saying that different compilers might give different answers?
Yikes!
Too clever indeed!
2009/3/26 rocon...@theorem.ca:
On Wed, 25 Mar 2009, Thomas Hartman wrote:
With the state version, there's a lot of
On Wed, 25 Mar 2009, Thomas Hartman wrote:
With the state version, there's a lot of behind-the-scenes magic, and
as we've seen, things can go wrong.
Also, the issue isn't infinite lists, but lists that are longer than
the sum of the partitions provided. The state monad partition version
goes
On Thu, 2009-03-26 at 12:29 -0700, Thomas Hartman wrote:
I wonder if JHC
or some other compiler might work better with these examples?
Are you saying that different compilers might give different answers?
Yikes!
Too clever indeed!
No, they might produce code with different
Well, that's reassuring.
The reason I asked is that the testp function didn't just show poor
performance. The state monad implementation actually gave a different
answer -- nonterminating, where the pattern matching solution
terminated.
2009/3/26 Jonathan Cast jonathancc...@fastmail.fm:
On Thu,
Colin Adams wrote:
2009/3/25 wren ng thornton w...@freegeek.org:
Most of the documentation is in research papers, and a normal
programmer don't want to read these papers.
Yes, and no. There is quite a bit of documentation in research papers, and
mainstream programmers don't read
2009/3/24 Jonathan Cast jonathancc...@fastmail.fm:
On Tue, 2009-03-24 at 22:33 +0300, Eugene Kirpichov wrote:
Pretty cool once you know what the function does, but I must admit I
wouldn't immediately guess the purpose of the function when written in
this way.
I wouldn't immediately guess the
What about
import Data.List
partAt n xs =
let (beg,end) = splitAt n xs
in beg : ( case end of
[] - []
xs - partAt n xs)
t = partAt 3 [1..10]
It's tail recursive (I think!) and should be pretty easy to understand
even for a beginner, no?
2009/3/24 Manlio Perillo
sorry, wrong function.
should be
partitions [] xs = []
partitions (n:parts) xs =
let (beg,end) = splitAt n xs
in beg : ( case end of
[] - []
xs - partitions parts xs)
t = partitions [1,2,3] [1..10]
which is not quite as nice, I admit.
2009/3/25 Thomas
wren ng thornton ha scritto:
Manlio Perillo wrote:
[...]
Following directly from the Rule of Least Power, if you can get away
with foreach then that's what you should use. Why? Because the less
power the construct has, the fewer corner cases and generalizations a
reader of the code needs to
The beauty of functional programming is that there doesn't have
to be a conflict between those who prefer explicit and those
who prefer implicit recursion. Think of them as different views
on the same functions - just as with graphical visualizations,
pick the view best suited to your purpose
On Tue, Mar 24, 2009 at 10:32 PM, wren ng thornton w...@freegeek.orgwrote:
Both of these conclusions seem quite natural to me, even from before
learning Haskell. It seems, therefore, that naturality is not the proper
metric to discuss. It's oft overlooked, but the fact is that expressivity
2009/3/25 Zachary Turner divisorthe...@gmail.com:
On the other hand, -certain- languages are more expressive than others. As
an example, I personally find English far more expressive than both
Vietnamese and Japanese, yet English is far more complicated. Japanese, for
Way off topic, but for
Thomas Hartman wrote:
sorry, wrong function.
should be
partitions [] xs = []
partitions (n:parts) xs =
let (beg,end) = splitAt n xs
in beg : ( case end of
[] - []
xs - partitions parts xs)
It's not tail recursive, FWIW. The recursive expression has (:) as
So to be clear with the terminology:
inductive = good consumer?
coinductive = good producer?
So fusion should be possible (automatically? or do I need a GHC rule?) with
inductive . coinductive
Or have I bungled it?
Dan
wren ng thornton wrote:
Thomas Hartman wrote:
sorry, wrong
Are you saying there's a problem with this implementation? It's the
Yes, there is actually a problem with this implementation.
import Data.List
import Control.Monad.State
import Debug.Trace.Helpers
partitions [] xs = []
partitions (n:parts) xs =
let (beg,end) = splitAt n xs
in beg : (
However, there is something to be said for code that just looks like a
duck and quacks like a duck. It's less likely to surprise you.
So... I insist... Easy for a beginner to read == better!
All you have said is that one building a skyscraper will need
scaffolding, blueprints, and a good
On Wed, 2009-03-25 at 12:48 -0700, Dan Weston wrote:
However, there is something to be said for code that just looks like a
duck and quacks like a duck. It's less likely to surprise you.
So... I insist... Easy for a beginner to read == better!
All you have said is that one building a
Oh, and incidentally, if you change to Control.Monad.State.Strict
*Main testP partitionsTooFrickinClever
testP partitionsTooFrickinClever^J*** Exception: stack overflow
Don't get me wrong -- I have learned a lot from this thread, and I
think it would be really cool if there was a way to do this
Since this thread is ostensibly about haskell style, it should also be
about haskell style *today*.
As I think Yitz noted earlier, this is a moving target.
Adoption of haskell by the masses -- moving.
Skill of haskell hordes -- moving.
Abstractions available as part of idiomatic haskell, and
Not only is your simpler function easier to read, it is also more correct.
partitionsHubris xs ns = zipWith take ns . init $ scanl (flip drop) xs ns
partitionsBeginner :: [Int] - [a] - [[a]]
partitionsBeginner [] _ = []
partitionsBeginner _ [] = []
partitionsBeginner (n : ns)
s/Pattern matching is awesome language feature. use it!
/Pattern matching is awesome language feature. Don't be ashamed to use it! /
:)
2009/3/25 Thomas Hartman tphya...@gmail.com:
Not only is your simpler function easier to read, it is also more correct.
partitionsHubris xs ns = zipWith
Manlio Perillo wrote:
The main problem, here, is that:
- recursion and pattern matching are explained in every tutorial about
functional programming and Haskell.
This is the reason why I find them more natural.
- high level, Haskell specific, abstractions, are *not* explained in
normal
Dan Weston wrote:
So to be clear with the terminology:
inductive = good consumer?
coinductive = good producer?
So fusion should be possible (automatically? or do I need a GHC rule?) with
inductive . coinductive
Or have I bungled it?
Not quite. Induction means starting from base cases
On Wed, Mar 25, 2009 at 12:44 PM, Thomas Hartman tphya...@gmail.com wrote:
Are you saying there's a problem with this implementation? It's the
Yes, there is actually a problem with this implementation.
However, there is something to be said for code that just looks like a
duck and quacks
Beginner list processing code can and often does go awry when presented with
infinite lists.
I didn't mean code that a beginner would write, I mean code that would
be easy to understand for a beginner to read -- that is, explicit
pattern matching, explicit recursion, no gratuitous use of state
Hi.
In these days I'm discussing with some friends, that mainly use Python
as programming language, but know well other languages like Scheme,
Prolog, C, and so.
These friends are very interested in Haskell, but it seems that the main
reason why they don't start to seriously learning it, is
These friends are very interested in Haskell, but it seems that the main
reason why they don't start to seriously learning it, is that when they start
reading some code, they feel the Perl syndrome.
That is, code written to be too smart, and that end up being totally
illegible by Haskell
I know what you're saying, in a way. There is much haskell code that's
completely illegible to me. I would say there is a difference between
Haskell and Perl though, in that Perl code is too smart aka. clever,
while Haskell code is usually simply, well, too smart. This means code
written using
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Manlio Perillo wrote:
| These friends are very interested in Haskell, but it seems that the main
| reason why they don't start to seriously learning it, is that when they
| start reading some code, they feel the Perl syndrome.
|
| That is, code
Well, I'd say that there is something close to the Perl syndrome, in
some sense. After all, code IS usually very smart. The difference is
that in Perl all smartness is about knowing how the computer works, or
how the interpreter works. In Haskell, instead, the smartness is about
knowing -
Tim Newsham ha scritto:
These friends are very interested in Haskell, but it seems that the
main reason why they don't start to seriously learning it, is that
when they start reading some code, they feel the Perl syndrome.
That is, code written to be too smart, and that end up being totally
Jake McArthur ha scritto:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Manlio Perillo wrote:
| These friends are very interested in Haskell, but it seems that the main
| reason why they don't start to seriously learning it, is that when they
| start reading some code, they feel the Perl
On Tue, 2009-03-24 at 19:42 +0100, Manlio Perillo wrote:
Tim Newsham ha scritto:
These friends are very interested in Haskell, but it seems that the
main reason why they don't start to seriously learning it, is that
when they start reading some code, they feel the Perl syndrome.
That
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Manlio Perillo wrote:
| This is right.
| The problem is that often (IMHO) a function definition can be rewritten
| so that it is much more readable.
|
| As an example, with the takeList function I posted.
I looked at it, found nothing wrong with the
1 - 100 of 286 matches
Mail list logo