On 6/20/09, Andrew Coppin andrewcop...@btinternet.com wrote:
Is this a known bug in GHC 6.10.1? Will upgrading fix it? (Obviously, it's
quite a lot of work to change GHC.) Suffice it to say that my program is
quite big and complicated; it worked fine when it was still small and
simple. ;-)
Hello Haskell users
If you're in the Edinburgh (Scotland!) area and interested in Haskell
we may have just the thing for you.
I will be meeting one other Haskell Cafe list member at Doctor's pub
at 4pm this afternoon (Sunday 21 June). This could be the start of
something bigger, so if you're
Raynor Vliegendhart wrote:
There is a bug in ghci 6.10.1 that seems to be fixed in 6.10.3 (not
sure whether it's fixed in 6.10.3). Certain non-terminating
expressions causes ghci to crash immediately and go back to the
prompt:
C:\ghci
GHCi, version
Andrew Coppin wrote:
Anyway, I shall try 6.10.3 and see what happens.
Recompiled my program. It now throws a loop exception (which the
exception handler catches) instead of just dying.
(Curiosly, the exception handler itself then throws an exception saying
stdin: hGetLine: illegal
Deniz Dogan wrote:
I (too) often find myself writing code such as this:
if something
then putStrLn howdy there!
else if somethingElse
then putStrLn howdy ho!
else ...
I recall reading some tutorial about how you can use the Maybe monad
if your code starts looking like
Hello Andrew,
Sunday, June 21, 2009, 1:52:22 PM, you wrote:
d1x - doesDirectoryExist d1
if d1x
then do
f1x - doesFileExist (d1 / f1)
if f1x
then do
d2x - doesDirectoryExist d2
if d2x
then do
f2x - doesFileExist
I (too) often find myself writing code such as this:
if something
then putStrLn howdy there!
else if somethingElse
then putStrLn howdy ho!
else ...
1. recognize something odd. done.
2. look for improvements. good.
3. define suitable abstractions for your special case
4.
On Jun 21, 2009, at 11:52 AM, Andrew Coppin wrote:
In a similar vein:
d1x - doesDirectoryExist d1
if d1x
then do
f1x - doesFileExist (d1 / f1)
if f1x
then do
d2x - doesDirectoryExist d2
if d2x
then do
f2x - doesFileExist (d2 / f2)
if
Sebastian Fischer wrote:
using Control.Monad.Error:
either (hPutStrLn stderr) return = runErrorT $
do d1x - lift $ doesDirectoryExist d1
unless d1x $ fail Directory ++ d1 ++ not found.
f1x - lift $ doesFileExist (d1 / f1)
unless f1x $ fail File ++ f1 ++ not found.
d2x
On Jun 21, 2009, at 2:36 PM, Sebastian Fischer wrote:
On Jun 21, 2009, at 11:52 AM, Andrew Coppin wrote:
...
When using
failUnless boolAction message = lift boolAction = (`unless`fail
message)
the code becomes
either (hPutStrLn stderr) return = runErrorT $
do failUnless
OK, so I'm guessing there might be one or two (!) people around here who
know something about the Lambda calculus.
I've written a simple interpretter that takes any valid Lambda
expression and performs as many beta reductions as possible. When the
input is first received, all the variables
forgot to cc the cafe :-)
On Sun, Jun 21, 2009 at 1:08 PM, Keith Sheppardkeiths...@gmail.com wrote:
hmm, it's been a while but...
i think this infinite loop with a free variable would cause collision
(\a . a a) (\b . b b d)
On Sun, Jun 21, 2009 at 12:53 PM, Andrew
An answer would probably depend on the reductions order you've chosen.
Would that do?
(\e - e (\u - e (\v - u))) (\f - \x - f x) -- all variables have
different names, see?
= (\f - \x - f x) (\u - (\f - \x - f x) (\v - u))
= \x - (\u - (\f - \x - f x) (\v - u)) x
= \x - (\f - \x - f x)
On Sun, Jun 21, 2009 at 8:53 PM, Andrew
Coppinandrewcop...@btinternet.com wrote:
OK, so I'm guessing there might be one or two (!) people around here who
know something about the Lambda calculus.
I've written a simple interpretter that takes any valid Lambda expression
and performs as many
2009/6/21 Andrew Coppin andrewcop...@btinternet.com:
OK, so I'm guessing there might be one or two (!) people around here who
know something about the Lambda calculus.
I've written a simple interpretter that takes any valid Lambda expression
and performs as many beta reductions as possible.
On Thu, 2009-06-18 at 23:26 -0500, Vasili I. Galchin wrote:
Hello,
Haskell packages on Hackage can be hosted anywhere, yes?
Yes.
If a Haskell package is hosted on Hackage, how often is it
backed up?
It's not especially wise to rely on Hackage for your backup needs since
it
Correction: I think that one can find an expression that causes name
clashes anyway, I'm just not certain that there is one that would
clash independent of whichever order you choose.
On 21 Jun 2009, at 21:12, Miguel Mitrofanov wrote:
An answer would probably depend on the reductions order
scratch that... it's completely wrong
On Sun, Jun 21, 2009 at 1:09 PM, Keith Sheppardkeiths...@gmail.com wrote:
forgot to cc the cafe :-)
On Sun, Jun 21, 2009 at 1:08 PM, Keith Sheppardkeiths...@gmail.com wrote:
hmm, it's been a while but...
i think this infinite loop with a free variable
On Sun, Jun 21, 2009 at 05:53:04PM +0100, Andrew Coppin wrote:
I've written a simple interpretter that takes any valid Lambda
expression and performs as many beta reductions as possible. When the
input is first received, all the variables are renamed to be unique.
Question: Does this
On Sun, Jun 21, 2009 at 05:53:04PM +0100, Andrew Coppin wrote:
OK, so I'm guessing there might be one or two (!) people around here who
know something about the Lambda calculus.
I've written a simple interpretter that takes any valid Lambda expression
and performs as many beta reductions as
Miguel Mitrofanov wrote:
Correction: I think that one can find an expression that causes name
clashes anyway, I'm just not certain that there is one that would clash
independent of whichever order you choose.
Yes there is.
Consider
(\f g - f (f (f (f (f (f g)) (\l a b - l (b a)) (\x -
Lauri Alanko wrote:
With name collisions I'm assuming you mean inadvertent variable
capture. The answer depends on your evaluation strategy. If you never
reduce inside a lambda (e.g. call-by-name or call-by-value), then you
will always be substituting a closed term in place of a variable, and
Hello, haskellers,
I've faced with some issue: how to store passwords securely on client's
side? Of course there are many technics how to hash them on server side but
sure all of them can't be used in my case (because of nature of hash).
There is some platform-independent application written on
Wow. Now you've showed it to me, it seems pretty obvious. That's what
I like about math.
On 21 Jun 2009, at 21:56, Bertram Felgenhauer wrote:
Miguel Mitrofanov wrote:
Correction: I think that one can find an expression that causes name
clashes anyway, I'm just not certain that there is one
Probably the easiest way to fix this was already proposed by Deniz
Dogan: de Bruijn indices.
On 21 Jun 2009, at 21:57, Andrew Coppin wrote:
Lauri Alanko wrote:
With name collisions I'm assuming you mean inadvertent variable
capture. The answer depends on your evaluation strategy. If you
Andrew Coppin wrote:
Ladies and gentlemen, we have a counter-example!
(\x1 - x1 x1) (\y2 - \z3 - y2 z3)
(\y2 - \z3 - y2 z3) (\y2 - \z3 - y2 z3)
\z3 - (\y2 - \z3 - y2 z3) z3
\z3 - \z3 - z3 z3
Now the operative question becomes... how in the name of God to I fix
this?
(The obvious
Andrew Coppin wrote:
Well anyway, the obvious thing to do is after each reduction, strip
off all the variable indicies and rerun the labeller to assign new
indicies. But does this solution work properly in general?
No.
Supposing some Lambda expression eventually reduces to, say,
\x1 - \x2
I have a datatype with about a dozen constructors. I'd like to find a
way to use the type system to prevent one of the constructors from being
used in certain places. But I can't think of a way to do that.
data Foobar =
Foo Foobar |
Bar Foobar |
Zoo Foobar
I want the type system to
Am Sonntag 21 Juni 2009 21:24:24 schrieb Andrew Coppin:
I have a datatype with about a dozen constructors. I'd like to find a
way to use the type system to prevent one of the constructors from being
used in certain places. But I can't think of a way to do that.
data Foobar =
Foo Foobar
Niklas Broberg wrote:
On Sun, Jun 21, 2009 at 9:24 PM, Andrew
Coppinandrewcop...@btinternet.com wrote:
data Foobar =
Foo Foobar |
Bar Foobar |
Zoo Foobar
I want the type system to track whether or not Zoo has been used in a
specific value. Sure, you can check for it at runtime, but
Hi all,
I want to learn how to optimize Haskell code on the Norvig's spelling
correction program [1]. Peter Norvig has written the program in
Python,
quite a literate translation to Haskell (thanks to Grzegorz Chrupala)
[2] was also available.
Both versions are about 23 LOCs, and Haskell version
Hello,
Have you read the lambda calculus chapter in:
The Implementation of Functional Programming Languages by Simon Peyton
Jones, published by Prentice Hall, 1987:
http://research.microsoft.com/en-us/um/people/simonpj/papers/slpj-book-1987/
- jeremy
On Sun, Jun 21, 2009 at 9:24 PM, Andrew
Coppinandrewcop...@btinternet.com wrote:
I have a datatype with about a dozen constructors. I'd like to find a way to
use the type system to prevent one of the constructors from being used in
certain places. But I can't think of a way to do that.
data
Niklas Broberg wrote:
That's what GADTs are for:
data Flag = HasZoo | NoZoo
data Foobar a where
Foo :: Foobar a - Foobar a
Bar :: Foobar a - Foobar a
Zoo :: Foobar a - Foobar HasZoo
Ouch #1: This appears to instantly disable deriving the Eq, Ord and Show
instances I want. :-/
That's what GADTs are for:
data Flag = HasZoo | NoZoo
Eh, I wrote this a bit fast obviously (no dependent types here).
Like Daniel Fischer wrote, these should rather be separate data types, i.e.
data HasZoo
data NoZoo
The rest is still correct though.
data Foobar a where
Foo :: Foobar a
kamil:
Hi all,
I want to learn how to optimize Haskell code on the Norvig's spelling
correction program [1]. Peter Norvig has written the program in
Python,
quite a literate translation to Haskell (thanks to Grzegorz Chrupala)
[2] was also available.
Both versions are about 23 LOCs, and
On Sun, Jun 21, 2009 at 4:00 PM, Andrew
Coppinandrewcop...@btinternet.com wrote:
Niklas Broberg wrote:
On Sun, Jun 21, 2009 at 9:24 PM, Andrew
Coppinandrewcop...@btinternet.com wrote:
I want the type system to track whether or not Zoo has been used in a
specific value. Sure, you can check
David Menendez wrote:
If you don't need code that's polymorphic between Foobar HasZoo and
Foobar NoZoo, you could just newtype Foobar and only export smart
constructors.
Unfortunately I want to be able to print both of them out. (After all,
the printing algorithm is identical whether Zoo
Iliya Kuznetsov wrote:
Hello, haskellers,
I've faced with some issue: how to store passwords securely on client's
side? Of course there are many technics how to hash them on server side
but sure all of them can't be used in my case (because of nature of hash).
There is some
What are the keys in your Map? Strict ByteStrings?
And you're using ghc 6.10.x?
For the record, I use 6.10.1 and strict ByteString everywhere now. I
used to have some lazy IO with vanilla strings, but switching to
Data.ByteString.Char8.readFile didn't change the time at all. The
big.txt is
Hello List,
Is there any one else in favor of hiding the PortNum constructor in
Network.Socket in the next release? Here's why:
Prelude :m + Network.Socket Data.Word
Prelude Network.Socket Data.Word let p = 5000 :: Word16
Prelude Network.Socket Data.Word let p' = PortNum p
Prelude Network.Socket
Quoth John Van Enk vane...@gmail.com,
[... example showing that PortNum is stored in network byte order ]
Notice that using the PortNum constructor does not at all do what the
user expects. This really should be a hidden constructor.
Could you elaborate, what does the user expect?
As others have pointed out, it is not enough to rename before reduction.
It should be pretty obvious since when you do substitution and copy a
lambda expression into more than once place you will introduce
variables with the same name. You can keep unique variables by
cloning during substitution,
Actually, keeping all names distinct is not de Bruijn numbering, it's
called the Barendregt convention.
On Sun, Jun 21, 2009 at 7:05 PM, Deniz Dogandeniz.a.m.do...@gmail.com wrote:
2009/6/21 Andrew Coppin andrewcop...@btinternet.com:
OK, so I'm guessing there might be one or two (!) people
On Sun, Jun 21, 2009 at 6:02 PM, Donn Caved...@avvanta.com wrote:
Could you elaborate, what does the user expect?
Users will probably expect (PortNum 0x2000) to represent a port number
of 0x2000 (8192), not 0x0020 (32).
/jve
___
Haskell-Cafe mailing
I'm in favor of the entire Network library being reworked with an
improved API that is higher level and type-safe instead of a direct
translation/FFI of Berkeley sockets. I also would like the Network
package to export Data instances for headers while taking advantage of
pretty, prettyclass, and
On Sun, Jun 21, 2009 at 07:48:30PM +0100, Andrew Coppin wrote:
Andrew Coppin wrote:
Well anyway, the obvious thing to do is after each reduction, strip off
all the variable indicies and rerun the labeller to assign new indicies.
But does this solution work properly in general?
No.
Dear all,
I'm pleased to announce to you haskell-src-exts-0.5.7, which is truly
the first *real* release candidate for 1.0.0. By real, I mean that I
could consider releasing it in this state. It is feature complete,
fully documented, and has no remaining known bugs. But before I do,
I'd like to
All,
Just as ancillary information: ∃ a calculator on Hackage called
LambdaCalculator. Its rather short (loc wise) and fun to play with.
Thomas
On Sun, Jun 21, 2009 at 10:57 AM, Andrew
Coppinandrewcop...@btinternet.com wrote:
Lauri Alanko wrote:
With name collisions I'm assuming you mean
In the unix package, we have getProcessID. Is there a corresponding
method for finding the process ID in Windows?
/jve
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
ok ... thx
On Sun, Jun 21, 2009 at 12:14 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk
wrote:
On Thu, 2009-06-18 at 23:26 -0500, Vasili I. Galchin wrote:
Hello,
Haskell packages on Hackage can be hosted anywhere, yes?
Yes.
If a Haskell package is hosted on Hackage, how
Hello,
I am working with some existing code. where/let functions use the
same name for function parameters as the outer function and hence there is a
shadow warning from the compiler. To me it doesn't see totally
unreasonable to code like this the downside is the nasty ghc warnings.
Is
Vasili I. Galchin wrote:
I am working with some existing code. where/let functions use the
same name for function parameters as the outer function and hence there is a
shadow warning from the compiler. To me it doesn't see totally
unreasonable to code like this the downside is the
Hi,
I am using haskelldb and haskelldb-hdbc-sqlite3. Well, I finally got
the source compiled and ran, I got this error:
App: user error (SQL error: SqlError {seState = , seNativeError =
21, seErrorMsg = prepare 74: SELECT subject,\n timestamp\nFROM
notes as T1\nORDER BY timestamp DESC:
2009/6/22 Vasili I. Galchin vigalc...@gmail.com:
Hello,
I am working with some existing code. where/let functions use the
same name for function parameters as the outer function and hence there is a
shadow warning from the compiler. To me it doesn't see totally
unreasonable to code like
Erik de Castro Lopo wrote:
Vasili I. Galchin wrote:
I am working with some existing code. where/let functions use the
same name for function parameters as the outer function and hence there is a
shadow warning from the compiler. To me it doesn't see totally
unreasonable to code like this
Hello Kamil,
Monday, June 22, 2009, 12:01:40 AM, you wrote:
Right... Python uses hashtables while here I have a tree with log n
you can try this pure hashtable approach:
import Prelude hiding (lookup)
import qualified Data.HashTable
import Data.Array
import qualified Data.List as List
data
57 matches
Mail list logo