I was under the impression that STM code needed to be in its own
monad. I was looking at Control.Concurrent.STM.TChan, for example,
where signatures like this exist:
newTChan :: STM (TChan a)
readTChan :: TChan a -> STM a
writeTChan :: TChan a -> a -> STM ()
and then
ne
Mun,
I hope this ushers the era of Haskell games! I, for one, was
certainly looking for something like this.
Did you encounter any difficulties in your development because of
Haskell?
Was lazy evaluation ever a problem?
Why did you choose Yampa to program the game entities? Did this give
Tomasz Zielonka wrote:
> Aren't C and C++ space insensitive (except the preprocessor)?
Literally, yes, because the C and C++ compilers proper take preprocessor
tokens, not strings, as input, and hence do not see the whitespace at
all; the whitespace-sensitive tokenization having been completed by
On Tue, Nov 22, 2005 at 08:30:33AM +, Joel Reymont wrote:
> I was under the impression that STM code needed to be in its own
> monad. I was looking at Control.Concurrent.STM.TChan, for example,
> where signatures like this exist:
>
> newTChan :: STM (TChan a)
> readTChan :: TChan a ->
On Tue, Nov 22, 2005 at 10:39:22AM +0200, Antti-Juhani Kaijanaho wrote:
> Tomasz Zielonka wrote:
> > Aren't C and C++ space insensitive (except the preprocessor)?
> (In a totally space insensitive language, "andy" and "and y" would be
> tokenized the same way.)
Ah, I was wrong, here are some examp
Tomasz,
I think it's much simpler than that. I just changed the trace
function to send Just String down the channel. Whenever I send
Nothing (from waitForChildren) the logger just exits. Simple change
in two places, no need for MVars.
Did I miss anything? The program became much snappier,
On Tue, Nov 22, 2005 at 09:03:55AM +, Joel Reymont wrote:
> I think it's much simpler than that. I just changed the trace
> function to send Just String down the channel. Whenever I send
> Nothing (from waitForChildren) the logger just exits. Simple change
> in two places, no need for MVa
Yes in the sense that more than a few lines of code are now printed
on Windows. Not in the sense of the topic of this thread but then it
seems to be a Mac OSX-only issue.
Thanks, Joel
On Nov 22, 2005, at 9:14 AM, Tomasz Zielonka wrote:
The program became much snappier, btw.
Did i
Hello Joel,
Tuesday, November 22, 2005, 1:41:38 AM, you wrote:
JR> logger h die =
JR> do empty <- isEmptyChan parent
JR> unless empty $ do x <- readChan parent
JR> putStrLn x
JR> hPutStrLn h x
JR> alive <- isEmptyMVar die
JR
Hello Max,
Tuesday, November 22, 2005, 2:30:23 AM, you wrote:
>> 2) sequential functions application in OOP style:
>>
>> [1..100] .map (2*) .sum
ME> Great proposal! And the only feature haskell will lack is computable go to!
ME> And if we add both haskell would become the most expressive and
ME>
Am Montag, 21. November 2005 20:51 schrieb Henning Thielemann:
> On Mon, 21 Nov 2005, Wolfgang Jeltsch wrote:
> [...]
> > Hmm, printing code on paper isn't good for the environment.
>
> But is quite the same argument for e-paper. :-)
I already thought about this. But if your computer is turned o
Hello Joel,
Tuesday, November 22, 2005, 12:03:55 PM, you wrote:
JR> I think it's much simpler than that. I just changed the trace
JR> function to send Just String down the channel. Whenever I send
JR> Nothing (from waitForChildren) the logger just exits. Simple change
JR> in two places, no ne
Am Dienstag, 22. November 2005 07:33 schrieb David Menendez:
> Keean Schupke writes:
> > Haskell already has static records (in H98)
> >
> > Dynamic records are addressed by the HList library, which uses
> > extensions already present in GHC and Hugs (namely Multi-parameter
> > type-classes
Am Montag, 21. November 2005 20:34 schrieb Max Eronin:
> On 11/21/05, David Roundy <[EMAIL PROTECTED]> wrote:
> > class Coord a where
> > get_x :: a -> Double
> > get_y :: a -> Double
> > set_x :: Double -> a -> a
> > set_y :: Double -> a -> a
>
> I'd say this is a typical OO solution to th
This is the approach that I went with, thanks.
On Nov 22, 2005, at 9:26 AM, Bulat Ziganshin wrote:
can you just send Die message through the same Chan? it will be best
solution. you can even write:
--
http://wagerlabs.com/
___
Haskell-Cafe mail
Hello all,
My question is rather strange, maybe, even if simple:
Does ghci always translates with "-O" option set on?
I've done some measurements on an application
using ghc and ghci.
ghc compiled with no opmitization => program running
real988m59.260s
user989m1.325s
sys 0m0.704s
If I have a function:
f x y = add x y
and I want to type the function in isolation, then the type of 'add' is
essentially carried in the environment... Lets say I want to make this
type explicit in the type signature (where f is valid for any a where
there is an add function on a - ignoring
The HList code does not need overlapping-instances, however it does use
undecidable
instances. This is not however bad like overlapping instances is.
Overlapping instances
can break module independance (as in defining a new instance can change
the meaning
of an existing class in modules that are
My mistake, what you want is:
( mything .=. "something"
.*. value .=. (27::Int)
.*. logic .=. True
.*. HNil )
Admittedly the label creation would benefit from some syntactic sugar to
reduce typing...
Keean.
Bulat Ziganshin wrote:
Hello Keean,
Monday, November 21, 2005, 6:56:06
Cale Gibbard <[EMAIL PROTECTED]> writes:
> This really isn't so bad in practice though. I've certainly never been
> confused by it.
Well, what can I say? Good for you?
> You'd have to go out of your way to construct a
> situation in which it's potentially confusing
No.
> There are much more
Just a follow up to my last post ... The HList paper also presents a way of
removing overlapping instances from _any_ class. So infact support for
overlapping
instances is no longer required - and this removes all the messy
problems with
overlapping instances and functional dependancies.
The c
Just my 2p worth... If I were designing a language I would not have used
the '.' like Haskell does. One problem is that ascii does not support
enough symbols (Hmm, PL1 here we come). I guess my vote would go to
keeping the '.' as is to not break existing programs, and using a
different symbol f
On Tuesday 22 Nov 2005 10:39 am, Keean Schupke wrote:
> If I have a function:
>
>f x y = add x y
>
> and I want to type the function in isolation, then the type of 'add' is
> essentially carried in the environment...
I am no expert in type theory so I'm probably about to get way
out of my dept
Excellent link thanks! Not quite what I was thinking of - but definitely
related.
I'll give it a read and see if they want to existentially quantify
environments...
Keean.
Adrian Hey wrote:
On Tuesday 22 Nov 2005 10:39 am, Keean Schupke wrote:
If I have a function:
f x y = add x y
Am Montag, 21. November 2005 03:27 schrieb Sara Kenedy:
May I suggest
endBy anyToken semi ? -- optionally replace semi by "char ';'", if you don't
want to skip whitespace
I think this is what you want --- stop at the first semicolon.
If you want to ignore just a final semicolon, you might use
Am Dienstag, 22. November 2005 14:51 schrieben Sie:
> Am Montag, 21. November 2005 03:27 schrieb Sara Kenedy:
>
> May I suggest
>
> endBy anyToken semi ? -- optionally replace semi by "char ';'", if you
Oops, I confused endBy and manyTill !! Also below.
And since maybe there isn't any se
Hello,
I run as follows:
simple::Parser String
simple = do manyTill anyToken (semi <|> eof)
run:: Show a => Parser a -> String -> IO()
run p input
= case (parse p "" input) of
Left err -> do {putStr "parse error at " ;print err}
Right x -> print x
Par
Am Dienstag, 22. November 2005 15:58 schrieben Sie:
> Hello,
> I run as follows:
>
> simple::Parser String
> simple = do manyTill anyToken (semi <|> eof)
>
> run:: Show a => Parser a -> String -> IO()
>
> run p input
>
> = case (parse p "" input) of
>
> Left err -> do {putStr "p
Am Dienstag, 22. November 2005 11:39 schrieb Keean Schupke:
> [...]
> This seems to suggest:
>
> Add a == exists (add :: a -> a -> a)
Doesn't "exists" normally quantify over types and not over values?
> [...]
Best wishes,
Wolfgang
___
Haskell-Cafe
This function is already in the HList library (well early versions
anyway)... I dont think
this is in the current distribution. Its a generic constructor
wrapper. For example:
hMarkAll Just hlist
class HList l => HMarkAll c l m | c l -> m where
hMarkAll :: (forall a . a -> c a)
Hello ,
in the HCAR GHC team wrote "On the type system front, we hope to ...
Allow you to use data types as kinds, in a manner similar to Tim
Sheardâ–“s Omega language". can someone point me where i can read about
this?
--
Best regards,
Bulat mailto:[EMAIL PROTECTED]
_
Wolfgang Jeltsch wrote:
This seems to suggest:
Add a == exists (add :: a -> a -> a)
Doesn't "exists" normally quantify over types and not over values?
It is quantifying over types, it is saying there exists a type "a -> a
-> a" that has
at least one value we will call "add"...
I
Keean,
I sort of gave up on HList for the time being since I found easier
ways to solve my problem.
Mainly, I could not estimate the impact it would have on run-time
performance of my code and GHC not being able to compile the code was
not a good indication. Simon PJ fixed that error sinc
Just to clarify...
In the example given the existential would be satisfied if a==Int, and
there was a definition of:
add :: Int -> Int -> Int
IE add is a member of the set/type "a -> a -> a"...
Keean
Keean Schupke wrote:
Wolfgang Jeltsch wrote:
This seems to suggest:
Add a ==
That all depends... In theory all the HList stuff happens at compile
time, and what you are left with is normal function application... Of
course compilers arn't that good yet, but as a reasonable idea, consider
just that value level... Most of the extra work is the packing/unpacking
of pairs "
Read about Omega!
I have not written anything about what I plan to do in GHC, but basically it
amounts to allowing you to use a data type as a kind. Busy doing GADTs and
impredicativity at the moment though
Simon
| -Original Message-
| From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTE
--- Simon Peyton-Jones <[EMAIL PROTECTED]> wrote:
> Read about Omega!
>
I will.
> Busy doing GADTs and impredicativity at the moment though
>
Impredicativity?
===
Gregory Woodhouse <[EMAIL PROTECTED]>
"Interaction is the mind-body problem of computing."
--Philip Wadler
__
On Tue, Nov 22, 2005 at 11:07:07AM +0100, Dusan Kolar wrote:
> To be honest, I don't mind ghci optimizes always
> but saying it uses the same options as ghc is not
> entirely true and, for optimization, it's quite painful
> because one searches error where it is not.
I think the real source of you
Is there a shorter way to write the if-then-else part below?
--
tryTakeSeat :: [Word8] -> Word8 -> ScriptState (Maybe Word8)
tryTakeSeat _ _ =
do ...
if (cmdType cmd) /= (CmdSitError Server)
then return $ Just seat_num
else return Nothing
--
Thanks, Joel
-
Is there a shorter way to write the if-then-else part below?
if (cmdType cmd) /= (CmdSitError Server)
then return $ Just seat_num
else return Nothing
return $ if cmdType cmd /= CmdSitError Serv
then Just seat_num else Nothing
Arjan
___
I think this discussion has reached a point where it is of utmost importance
to re-read "Wadler's Law of Language Design", a law so fundamental to
computer science that it can only be compared to quantum dynamics in physics:
http://www.informatik.uni-kiel.de/~mh/curry/listarchive/0017.html
:
Arjan van IJzendoorn <[EMAIL PROTECTED]> writes:
>> Is there a shorter way to write the if-then-else part below?
>>if (cmdType cmd) /= (CmdSitError Server)
>> then return $ Just seat_num
>> else return Nothing
>
> return $ if cmdType cmd /= CmdSitError Serv
>
--- Sven Panne <[EMAIL PROTECTED]> wrote:
> I think this discussion has reached a point where it is of utmost
> importance
> to re-read "Wadler's Law of Language Design", a law so fundamental to
>
> computer science that it can only be compared to quantum dynamics in
> physics:
>
>http://
On Tue, 22 Nov 2005, Matthias Neubauer wrote:
Arjan van IJzendoorn <[EMAIL PROTECTED]> writes:
Is there a shorter way to write the if-then-else part below?
if (cmdType cmd) /= (CmdSitError Server)
then return $ Just seat_num
else return Nothing
return $ if cmdType
Am Dienstag, 22. November 2005 19:30 schrieb Greg Woodhouse:
> To be honest, I haven't followed the entire records thread (at least
> not yet), but I don't know that it's fair to say that we've been
> focusing entirely (or nearly so) on lexical issues. I'll grant you that
> there's an awful lot of
Am Dienstag, 22. November 2005 17:19 schrieben Sie:
> Wolfgang Jeltsch wrote:
> >>This seems to suggest:
> >>
> >>Add a == exists (add :: a -> a -> a)
> >
> >Doesn't "exists" normally quantify over types and not over values?
>
> It is quantifying over types, it is saying there exists a type "a
Hello Greg,
Tuesday, November 22, 2005, 8:24:41 PM, you wrote:
>> Busy doing GADTs and impredicativity at the moment though
>>
GW> Impredicativity?
just in the case you don't have time to read HCAR ;) some excerpt from
there:
2.1 The Glasgow Haskell Compiler
There is lots more in the
Hello Simon,
Tuesday, November 22, 2005, 8:17:38 PM, you wrote:
SPJ> I have not written anything about what I plan to do in GHC, but
SPJ> basically it amounts to allowing you to use a data type as a
SPJ> kind. Busy doing GADTs and impredicativity at the moment though
Simon, i can't download fil
Hello Matthias,
Tuesday, November 22, 2005, 9:17:57 PM, you wrote:
MN> return $ guard (cmdType cmd /= CmdSitError Serv) >> return seat_num
return $ when (cmdType cmd /= CmdSitError Serv) (return seat_num)
must also work :)
--
Best regards,
Bulatmailto:[EMAIL PROT
Bulat Ziganshin wrote:
Hello Simon,
Tuesday, November 22, 2005, 8:17:38 PM, you wrote:
SPJ> I have not written anything about what I plan to do in GHC, but
SPJ> basically it amounts to allowing you to use a data type as a
SPJ> kind. Busy doing GADTs and impredicativity at the moment though
S
On Tue, Nov 22, 2005 at 10:15:15PM +0300, Bulat Ziganshin wrote:
> Tuesday, November 22, 2005, 9:17:57 PM, you wrote:
>
> MN> return $ guard (cmdType cmd /= CmdSitError Serv) >> return seat_num
>
> return $ when (cmdType cmd /= CmdSitError Serv) (return seat_num)
>
> must also work :)
But it wo
Why wouldn't Bulat's version work?
I don't think it will work for me either way as I'm returning m
(Maybe Int) where m is my own monad. It seems that folks assumed that
m itself was the maybe monad. Unless I'm mistaken the code below
won't work otherwise.
On Nov 22, 2005, at 8:50 PM, Toma
Bulat Ziganshin <[EMAIL PROTECTED]> writes:
> Hello Matthias,
>
> Tuesday, November 22, 2005, 9:17:57 PM, you wrote:
>
> MN> return $ guard (cmdType cmd /= CmdSitError Serv) >> return seat_num
>
> return $ when (cmdType cmd /= CmdSitError Serv) (return seat_num)
>
> must also work :)
Only if seat
> Is there a shorter way to write the if-then-else part below?
>
> --
> tryTakeSeat :: [Word8] -> Word8 -> ScriptState (Maybe Word8)
> tryTakeSeat _ _ =
> do ...
>if (cmdType cmd) /= (CmdSitError Server)
> then return $ Just seat_num
> else return Nothing
> --
tryT
Joel Reymont <[EMAIL PROTECTED]> writes:
> I don't think it will work for me either way as I'm returning m
> (Maybe Int) where m is my own monad. It seems that folks assumed that
> m itself was the maybe monad. Unless I'm mistaken the code below
> won't work otherwise.
There are two monads involv
"Albert Lai" <[EMAIL PROTECTED]> writes:
> I offer a simpler, more direct, and pre-existing correspondence
between a functional
> programming construct and unix pipes:
Maybe my point wasn't clear. Of course this idea of comparing lazy
evaluation to Unix pipes is very old (long before July 2004,
Hi Haskell gurus,
I'm learning Haskell now and here I'm quite puzzled over some code
about Monad Transformers. The code is like:
type NDS a = StateT ProblemState [] a
getVar :: Var -> NDS (Maybe Value)
getVar v = do vs <- gets vars
return $ lookup v vs
What puzzles m
On Tue, Nov 22, 2005 at 05:26:00PM -0700, Fan Wu wrote:
>type NDS a = StateT ProblemState [] a
>
>getVar :: Var -> NDS (Maybe Value)
>getVar v = do vs <- gets vars
> return $ lookup v vs
>
>
> What puzzles me is that, I think the Monad of the do block shall be
> the
> is the word OOP persuade so strange on you?
No, my brain exploded by the examples and proposed rules made me look so
When it is exploding I often start acting funnily. And I was fortunate
enough not to begin biting the dogs and scratching the cats after an
attempt to predict an order of appl
On Tue, Nov 22, 2005 at 09:07:29PM +, Joel Reymont wrote:
> Why wouldn't Bulat's version work?
Because Int /= ()
when :: (Monad m) => Bool -> m () -> m ()
Best regards
Tomasz
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.has
On Tue, Nov 22, 2005 at 02:09:40PM -0800, Scherrer, Chad wrote:
> (\|) = flip ($) -- (#) seems to me too pretty for other purposes to use
> it here.
> infixl 0 \| -- Again, why can't this be negative or Fractional??
I have a ? operator that does the same thing. Next time I use it I'll
check if
Keean Schupke writes:
> David Menendez wrote:
>
> >Chris Kuklewicz writes:
> >
> >>Would the record system describe at
> >>http://lambda-the-ultimate.org/node/view/1119
> >>also be convertable "into System Fw, GHC's existing, strongly-typeed
> >>intermediate language." ?
> >
> >Probably. Daan's c
62 matches
Mail list logo