On May 19, 2009, at 01:42 , Jason Dagit wrote:
I've often seen this bit of scary code in VB:
Dim i as Integer = 5
If i = "5" Then
' Do something, because 5 = "5"
End If
Sure, that works in Perl too. But the equivalent case here would be
chr$(5), not "5".
--
brandon s. allbery [solaris,fr
On Mon, May 18, 2009 at 10:06 PM, Ryan Ingram wrote:
> On Mon, May 18, 2009 at 3:05 PM, Taral wrote:
>> Will this do?
>>
>> (>>=) :: (NFData sa, NFData b) => LI sa -> (sa -> LI b) -> LI b
>
> No, the problem is that >>= on monads has no constraints, it must have the
> type
>> LI a -> (a -> LI b)
2009/05/18 Miguel Mitrofanov :
> On 19 May 2009, at 09:06, Ryan Ingram wrote:
>
>> This is a common problem with trying to use do-notation; there are
>> some cases where you can't make the object an instance of Monad. The
>> same problem holds for Data.Set; you'd can write
>>
>> setBind :: Ord b =
I'm writing a paper as a replacement for writing exam and decided to write
a simple compiler (got a little experience with it). However, I got trouble
in parsing expression.
The grammar:
expression = "get" | [ "+" | "-" ] term { ( "+" | "-" ) term }
term = factor { ( "*" | "/" ) factor }
On 19 May 2009, at 09:06, Ryan Ingram wrote:
This is a common problem with trying to use do-notation; there are
some cases where you can't make the object an instance of Monad. The
same problem holds for Data.Set; you'd can write
setBind :: Ord b => Set a -> (a -> Set b) -> Set b
setBind m f
On Mon, May 18, 2009 at 10:13 PM, Brandon S. Allbery KF8NH
wrote:
> On May 19, 2009, at 01:07 , z_axis wrote:
>
> rollDice_t n = do
> hd <- openFile "/dev/random" ReadMode
> v <- B.hGet hd 1
> return (v `mod` n) + 1
>
> No instance for (Integral B.ByteString)
>
> You can't just read
On Mon, May 18, 2009 at 10:13 PM, Brandon S. Allbery KF8NH
wrote:
> On May 19, 2009, at 01:07 , z_axis wrote:
>
> rollDice_t n = do
> hd <- openFile "/dev/random" ReadMode
> v <- B.hGet hd 1
> return (v `mod` n) + 1
>
> No instance for (Integral B.ByteString)
>
> You can't just read
On May 19, 2009, at 01:07 , z_axis wrote:
rollDice_t n = do
hd <- openFile "/dev/random" ReadMode
v <- B.hGet hd 1
return (v `mod` n) + 1
No instance for (Integral B.ByteString)
You can't just read a binary string and have it interpreted as a
number; you want to use Data.Binary
Hi, friends
the following function works well
rollDice n = getStdRandom (randomR (1,n)) :: IO Int
now i want to use /dev/random to produce better random number, but it doesnot
work
rollDice_t n = do
hd <- openFile "/dev/random" ReadMode
v <- B.hGet hd 1
return (v `mod` n) + 1
No in
On Mon, May 18, 2009 at 3:05 PM, Taral wrote:
> Will this do?
>
> (>>=) :: (NFData sa, NFData b) => LI sa -> (sa -> LI b) -> LI b
No, the problem is that >>= on monads has no constraints, it must have the type
> LI a -> (a -> LI b) -> LI b
This is a common problem with trying to use do-notation;
Hello,
I know that some Lawvere papers are available on TAC, but is there a
list of all Lawvere papers online and where?
Kind regards,
Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-c
thank to all respondents!
Vasili
On Mon, May 18, 2009 at 9:41 PM, David Menendez wrote:
> On Mon, May 18, 2009 at 6:34 PM, Vasili I. Galchin
> wrote:
> > Hello,
> >
> > Do newSTArray, readSTArray, writeSTArray, etc. belong to an old
> > deprecated Hugs library/module? If so, what is the
_
Insert movie times and more without leaving Hotmail®.
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd1_052009___
Haskell-Cafe mailing list
Haskell-
On Mon, May 18, 2009 at 6:34 PM, Vasili I. Galchin wrote:
> Hello,
>
> Do newSTArray, readSTArray, writeSTArray, etc. belong to an old
> deprecated Hugs library/module? If so, what is the Haskell 98 replacement?
I don't know about Haskell 98, but I think the modern solution is to
use newArr
On Mon, May 18, 2009 at 10:02 PM, Ryan Ingram wrote:
> Unfortunately, you can't derive Show on Chain as defined, because it
> contains a function:
Sure you can. I just tried the following, and it compiled without complaints.
> import Text.Show.Functions
>
> data Chain = Link Int (Int -> Chain) d
Unfortunately, you can't derive Show on Chain as defined, because it
contains a function:
> data Chain = Link Int (Int -> Chain)
You can write this:
> instance Show Chain where
>show (Link n _) = "Link " ++ show n ++ " "
Or you can make a dummy "Show" instance for functions:
> instance Sho
On May 18, 2009, at 21:19 , michael rice wrote:
*Main> :t ints 0
ints 0 :: Chain
*Main> ints 0
:1:0:
No instance for (Show Chain)
In general, you want to append
deriving Show
to your types. You may also want to be able to input them in ghci, so
instead say
deriving (Show, R
On May 18, 2009, at 18:34 , Vasili I. Galchin wrote:
Do newSTArray, readSTArray, writeSTArray, etc. belong to an
old deprecated Hugs library/module? If so, what is the Haskell 98
replacement?
My understanding is they should be in the provided STArray module.
--
brandon s. allbery [so
I've been playing around with "The Little MLer" (pg. 95, 96) to try to improve
my understanding of types.
I can ask ML:
- ints(0);
val it = Link (1,fn) : chain
-
and Haskell:
*Main> :t ints 0
ints 0 :: Chain
*Main> ints 0
:1:0:
No instance for (Show Chain)
arising from a use of `pr
I've been playing around with "The Little MLer" (pg. 95, 96) to try to improve
my understanding of types.
I can ask ML:
- ints(0);
val it = Link (1,fn) : chain
-
and Haskell:
*Main> :t ints 0
ints 0 :: Chain
*Main> ints 0
:1:0:
No instance for (Show Chain)
arising from a use of `pr
Hello,
Do newSTArray, readSTArray, writeSTArray, etc. belong to an old
deprecated Hugs library/module? If so, what is the Haskell 98 replacement?
Thanks, Vasili
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/
On Mon, May 18, 2009 at 10:30 AM, Nicolas Pouillard
wrote:
> The type I would need for bind is this one:
>
> (>>=) :: NFData sa => LI sa -> (sa -> LI b) -> LI b
Will this do?
(>>=) :: (NFData sa, NFData b) => LI sa -> (sa -> LI b) -> LI b
--
Taral
"Please let me know if there's any further t
On Mon, May 18, 2009 at 11:33 AM, Eugene Kirpichov wrote:
> The main bullet point is missing: Correctness.
>
> How could we have forgotten quickcheck?
>
>> quickCheck (\xs -> sort (sort xs) == sort xs)
> OK, 100 tests passed.
I like this, but given that you have a whole slide, I might write this:
As I said, I don't get the fusion if I just add the function above to the
original Dist.hs, export it and compile the module with '-c -O2
-ddump-simpl':
I can't reproduce this.
Interesting. I'm using ghc 6.11.20090320 (windows), uvector-0.1.0.3.
I attach the modified Dist.hs and its simpl ou
claus.reinke:
>>> Once I actually add a 'dist_fast_inline_caller', that indirection
>>> disappears in the inlined code, just as it does for dist_fast itself.
>>>
>>>dist_fast_inlined_caller :: UArr Double -> UArr Double -> Bool
>>>dist_fast_inlined_caller p1 p2 = dist_fast_inlined p1 p2
Once I actually add a 'dist_fast_inline_caller', that indirection
disappears in the inlined code, just as it does for dist_fast itself.
dist_fast_inlined_caller :: UArr Double -> UArr Double -> Bool
dist_fast_inlined_caller p1 p2 = dist_fast_inlined p1 p2 > 2
However, in the simpl output
The main bullet point is missing: Correctness.
How could we have forgotten quickcheck?
> quickCheck (\xs -> sort (sort xs) == sort xs)
OK, 100 tests passed.
2009/5/18 Don Stewart :
> adam.turoff:
>> On Mon, May 18, 2009 at 2:06 PM, Don Stewart wrote:
>> > Exactly: focus on what the user wants t
adam.turoff:
> On Mon, May 18, 2009 at 2:06 PM, Don Stewart wrote:
> > Exactly: focus on what the user wants to do (e.g. write multicore code,
> > write safe code, write code quickly), not how that is achieved:
> > "bounded parametric polymorphism" or "monads"
>
> Parametric polymorphism is a big
On Mon, May 18, 2009 at 2:06 PM, Don Stewart wrote:
> Exactly: focus on what the user wants to do (e.g. write multicore code,
> write safe code, write code quickly), not how that is achieved:
> "bounded parametric polymorphism" or "monads"
Parametric polymorphism is a big win, and highlights some
ekirpichov:
> Actually, I don't think it's a good idea to introduce monads on one of
> the 3-4 slides. While it *is* a core concept, it's not one of the
> advertising "bullet points"; and 1 slide is not enough to show what
> *use* monads are, let alone what they actually *are*.
>
> I'd probably su
jfredett:
> While an incredibly small font is a clever option, a more serious
> suggestion may be as follows.
>
> 3-4 slides imply 3-4 topics, so the question is what are the 3-4 biggest
> topics in haskell? I would think they would be:
>
> * Purity/Referential Transparency
> * Lazy Evaluation
On 18 May 2009, at 20:29, Joe Fredette wrote:
While an incredibly small font is a clever option, a more serious
suggestion may be as follows.
3-4 slides imply 3-4 topics, so the question is what are the 3-4
biggest topics in haskell? I would think they would be:
* Purity/Referential Tran
Well, since the topic was EDSLs, and those generally involve monads (at
least from what I've seen), it might be wise to touch on them. However,
perhaps the fourth slide would just be a catchall? HOFs, some STM/Monad
stuff, etc? The topics I suggested just seem to me to be the 4 core
concepts yo
Excerpts from Jason Dusek's message of Sun May 17 15:45:25 +0200 2009:
> From the documentation:
>
> " LI could be a strict monad and a strict applicative functor.
> However it is not a lazy monad nor a lazy applicative
> functor as required Haskell. Hopefully it is a lazy
> (point
Tons of relevant changes. Almost too many to count...
Buster:
- Fixed performance and bugs in buster,
- split out buster, buster-network, and buster-gtk to make it easier
to only build components of the system.
- Added new functions in buster for selection and debugging.
- Added behaviours in App
I've got one of those algorithms which "threatens to march off the right edge" (in the words of
Goerzen et al). I need something like a State or Maybe monad, but this is inside the IO monad.
So I presume I need StateT or MaybeT. However, I'm still (sdlowly) learning about monads from
first princ
On Mon, May 18, 2009 at 3:08 AM, Neil Brown wrote:
> With ErrorT you can use throwError when you want to break out of the
> block and give back an error, which seems to fit what you were doing.
Of course, now that you are using throwError, you can remove a lot of
the extra indentation:
> insertN
Am Sonntag, 17. Mai 2009 15:08:29 schrieb Don Stewart:
> Sven.Panne:
> > [...]
> > I think most problems can be fixed in a rather pragmatic way by adding a
> > few functions to the binary package:
> [...]
> Patches are welcome.
Attached. A few remarks:
* This is only a quick and mildly tested im
Actually, I don't think it's a good idea to introduce monads on one of
the 3-4 slides. While it *is* a core concept, it's not one of the
advertising "bullet points"; and 1 slide is not enough to show what
*use* monads are, let alone what they actually *are*.
I'd probably suggest you to show someth
Don't forget to include higher-order functions in one of those important
points.
On Mon, May 18, 2009 at 12:36 PM, John Van Enk wrote:
> Thanks Joe,
>
> Your assumption is correct--the whole presentation will be longer. I wanted
> to use 3 or 4 slides to introduce the language and the balance fo
Thanks Joe,
Your assumption is correct--the whole presentation will be longer. I wanted
to use 3 or 4 slides to introduce the language and the balance for the
interesting stuff. :P
/jve
PS to Joe: I will not forget to reply to all. I will not forget to reply to
all. I will not forget to reply to
While an incredibly small font is a clever option, a more serious
suggestion may be as follows.
3-4 slides imply 3-4 topics, so the question is what are the 3-4 biggest
topics in haskell? I would think they would be:
* Purity/Referential Transparency
* Lazy Evaluation
* Strong Typing + Type C
On 16:25 Mon 18 May , Gü?nther Schmidt wrote:
> Hi all,
>
> I'm trying to express a constraint using a data structure.
>
> Let's say I'd want to express a "mapping" of a to b, c to b, d to b and e
> to f.
>
> A mapping can also be from a to a, b to b and so on.
>
> The constraint is that one c
Use an incredibly small font AND Haskell FRP [1] to zoom and enlarge
the font as you move your mouse over the text. ;)
1. http://en.wikipedia.org/wiki/Functional_reactive_programming
--
Donnie Jones
On Mon, May 18, 2009 at 10:56 AM, David Leimbach wrote:
> Use an incredibly small font.
>
> On
claus.reinke:
>>> dist_fast :: UArr Double -> UArr Double -> Double
>>> dist_fast p1 p2 = sumDs `seq` sqrt sumDs
>>> where
>>> sumDs = sumU ds
>>> ds= zipWithU euclidean p1 p2
>>> euclidean x y = d*d
>>>
Use an incredibly small font.
On Mon, May 18, 2009 at 8:16 AM, John Van Enk wrote:
> Hi all,
>
> I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at
> the end of June. I need a 3 to 4 slide introduction to Haskell. What
> suggestions does the community have? Is such a sho
dist_fast :: UArr Double -> UArr Double -> Double
dist_fast p1 p2 = sumDs `seq` sqrt sumDs
where
sumDs = sumU ds
ds= zipWithU euclidean p1 p2
euclidean x y = d*d
where
Brilliant! Thanks.
-Original Message-
From: Don Stewart [mailto:d...@galois.com]
Sent: Mon 18/05/2009 16:21
To: Sam Martin
Cc: Kenneth Hoste; Haskell Cafe mailing list
Subject: Re: de-sugared code? (branch from: fast Eucl. dist. - Haskell vs C)
Yes, I use the ghc-core tool:
http://
Yes, I use the ghc-core tool:
http://hackage.haskell.org/cgi-bin/hackage-scripts/package/ghc-core
sam.martin:
> Hi Don (and cafe),
>
> Given the example you just posted, is there a simple way to generate the
> de-sugared haskell / core / STG / labelled-assembly versions of a piece of
> haske
That's the output of ghc -ddump-simpl.
2009/5/18 Sam Martin :
> Hi Don (and cafe),
>
> Given the example you just posted, is there a simple way to generate the
> de-sugared haskell / core / STG / labelled-assembly versions of a piece of
> haskell code? For instance, how did you generate the conten
Hi Don (and cafe),
Given the example you just posted, is there a simple way to generate the
de-sugared haskell / core / STG / labelled-assembly versions of a piece of
haskell code? For instance, how did you generate the content below? I guess
this is the core language version?
I'm a C/C++ code
vanenkj:
> Hi all,
>
> I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at
> the
> end of June. I need a 3 to 4 slide introduction to Haskell. What suggestions
> does the community have? Is such a short intro possible?
>
> It just needs to introduce the basics so I can
Just please don't show them qsort and fibonacci!
2009/5/18 John Van Enk :
> Hi all,
>
> I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at
> the end of June. I need a 3 to 4 slide introduction to Haskell. What
> suggestions does the community have? Is such a short intro po
Hi all,
I'm giving a presentation to an IEEE group on Embedded DSL's and Haskell at
the end of June. I need a 3 to 4 slide introduction to Haskell. What
suggestions does the community have? Is such a short intro possible?
It just needs to introduce the basics so I can show some code without
alien
Hi all,
I'm trying to express a constraint using a data structure.
Let's say I'd want to express a "mapping" of a to b, c to b, d to b and
e to f.
A mapping can also be from a to a, b to b and so on.
The constraint is that one cannot map a to b if b was already "mapped"
to let's say c.
I'
kenneth.hoste:
> Hello,
>
> For a while now, I've been trying to come up with a fast Haskell-only
> function which implements Euclidean distance in n-dimensional space.
>
> So far, I've been disappointed by the performance of my best effort
> in Haskell, compared to C. I'm hoping some of the Haskel
My current best try uses the uvector package, has two 'vectors' of type
(UArr Double) as input, and relies on the sumU and zipWithU functions
which use streaming to compute the result:
dist_fast :: UArr Double -> UArr Double -> Double
dist_fast p1 p2 = sumDs `seq` sqrt sumDs
where
Hello,
For a while now, I've been trying to come up with a fast Haskell-only
function which implements Euclidean distance in n-dimensional space.
So far, I've been disappointed by the performance of my best effort
in Haskell, compared to C. I'm hoping some of the Haskell experts
and/or performan
On 13/05/2009 13:07, Duncan Coutts wrote:
On Wed, 2009-05-13 at 15:37 +0400, Bulat Ziganshin wrote:
Hello Duncan,
Wednesday, May 13, 2009, 3:33:13 PM, you wrote:
I think it should remain deprecated and we should work on the
replacement so that TH can switch its dependency.
TH isn't high-perf
Vasili I. Galchin schrieb:
> Hello,
>
> I am confused between Haskell as delineated in the Haskell Report
> VS ghc "pragmas" which extend Haskell beyond the Haskell Report. I am
> sure I am not the first to ask. Caveat: on my part, I am not against
> innovation/extensions, but I don't like to
I've got one of those algorithms which "threatens to march off the right edge" (in the words of
Goerzen et al). I need something like a State or Maybe monad, but this is inside the IO monad. So
I presume I need StateT or MaybeT. However, I'm still (slowly) learning about monads from first
princi
On 13/05/2009 19:53, Donnie Jones wrote:
Hello Dan,
Best place to ask is glasgow-haskell-us...@haskell.org since that is
the GHC users list.
I have CC'd your email to the GHC user list.
Cheers.
--
Donnie Jones
On Wed, May 13, 2009 at 1:35 PM, Dan wrote:
Hi,
Not sure if this is the right pla
Hi,
I regularly (almost daily) have problems reaching both community and
code.haskell.org, getting 500 server error messages. I've decided to
make all my Haskell code available on community, which means that when
it goes down, I can't access my repos - which is not great.
Is there a reason for th
Michael P Mossey wrote:
I've got one of those algorithms which "threatens to march off the
right edge" (in the words of Goerzen et al). I need something like a
State or Maybe monad, but this is inside the IO monad. So I presume I
need StateT or MaybeT. However, I'm still (slowly) learning about
Hi
Questions of parametricity in dependent types are made more
complex by the way in which the "Pi-type"
(x : S) -> T
corresponds to universal quantification. It's good to think
of this type as a very large product, tupling up individual
T's for each possible x you can distinguish by observat
Hi,
I regularly (almost daily) have problems reaching both community and
code.haskell.org, getting 500 server error messages. I've decided to
make all my Haskell code available on community, which means that when
it goes down, I can't access my repos - which is not great.
Is there a reason for th
TFM2009
2nd Int. FME Conference on Teaching Formal Methods
"Widening Access to Formal Methods"
Friday, November 6th 2009, co-located with
FM2009 : 16th International Symposium
67 matches
Mail list logo