Re: [Haskell] ANN: Yi 0.6.3

2011-03-28 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 3/28/11 21:29 , Ivan Lazar Miljenovic wrote:
> On 29 March 2011 12:19, Brandon S Allbery KF8NH  wrote:
>>> No, my meaning was that the reasoning of "I don't need to specify this
>>> as a dependency since it's part of the Platform" isn't sound since not
>>> everyone has the Platform.
>>
>> The point of the Platform is to provide a baseline.  So you *are* saying it
>> is pointless, because you want packages to confirm to a different baseline.
> 
> My impression that the Platform was a baseline in regards to "what do
> I need to get started to develop with Haskell?", and not in terms of
> specifying dependencies.  After all, we still need to specify a
> dependency on `base' in .cabal files, even though it comes with GHC
> and other compilers (let alone the Platform)?

And it regularly causes annoying dependency issues, including causing cabal
to regularly do diamond dependencies.

Somehow the Haskell community is hellbent on repeating the mistakes every
other community learned about the hard way years ago, especially in the area
of dependencies (first refusing to acknowledge the need for upper dependency
limits, more recently trying to avoid adding an epoch — and I'm not counting
how packages included with the compiler but not recognized as such by Cabal
lead directly to Cabal introducing diamond dependency failures).  Is this
*really* necessary, or should those of us who've seen it before just sit
back and watch you all ram your heads against the same brick walls?

(Why no, it doesn't look like a brick wall now; that's the point.  It
*will*.  Learn *before* it happens.)

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]allber...@gmail.com
system administrator  [openafs,heimdal,too many hats]kf8nh
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2RODUACgkQIn7hlCsL25VOXwCguwsUCVTZoDyh8FxD9buJkiO5
AzIAoLC61yrpRTi9bmId13hupf1dc9Tl
=vL+w
-END PGP SIGNATURE-

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANN: Yi 0.6.3

2011-03-28 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 3/28/11 21:15 , Ivan Lazar Miljenovic wrote:
> On 29 March 2011 12:10, Brandon S Allbery KF8NH  wrote:
>> -BEGIN PGP SIGNED MESSAGE-
>> Hash: SHA1
>>
>> On 3/28/11 17:06 , Ivan Lazar Miljenovic wrote:
>>> On 29 March 2011 06:40, Jeff Wheeler  wrote:
>>>> Oh, my bad. I removed this because alex is included in the Platform,
>>>> so it seemed like it'd always be available. I'll add it back.
>>>
>>> Not *everyone* has the Platform installed! (I prefer to install ghc
>>> and then just the libraries I need via my package manager).
>>
>> So you're saying that the Platform is pointless?  I think there's some
>> miscommunication going on somewhere, if we're all going to pretend it
>> doesn't exist.
> 
> No, my meaning was that the reasoning of "I don't need to specify this
> as a dependency since it's part of the Platform" isn't sound since not
> everyone has the Platform.

The point of the Platform is to provide a baseline.  So you *are* saying it
is pointless, because you want packages to confirm to a different baseline.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]allber...@gmail.com
system administrator  [openafs,heimdal,too many hats]kf8nh
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2RM5MACgkQIn7hlCsL25UgggCg01PqGZflU7EQdEa03TR9sMEE
CrwAoICxWlsJmPhhq3MEbSdkzyR1x+CL
=km8w
-END PGP SIGNATURE-

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANN: Yi 0.6.3

2011-03-28 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 3/28/11 17:06 , Ivan Lazar Miljenovic wrote:
> On 29 March 2011 06:40, Jeff Wheeler  wrote:
>> Oh, my bad. I removed this because alex is included in the Platform,
>> so it seemed like it'd always be available. I'll add it back.
> 
> Not *everyone* has the Platform installed! (I prefer to install ghc
> and then just the libraries I need via my package manager).

So you're saying that the Platform is pointless?  I think there's some
miscommunication going on somewhere, if we're all going to pretend it
doesn't exist.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]allber...@gmail.com
system administrator  [openafs,heimdal,too many hats]kf8nh
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk2RMZsACgkQIn7hlCsL25UrNACfaLU53OZXL/qRzhMhU/1+6KvA
OksAoNH6aJVlIdmAQQjRnCW8HPgNvOcT
=WNJG
-END PGP SIGNATURE-

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] a quick question

2011-02-03 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 2/2/11 22:01 , Ramy Abdel-Azim wrote:
> No need to apologize. Not dumb of you. The mandatory else is unusual. I
> don't personally know of any other language that requires an else for every 
> if.

Haskell's if is an expression, best compared to the ?-: ternary operator in
C and Perl or Python's if-else operator instead of to a control structure.

- -- 
brandon s. allbery [linux,solaris,freebsd,perl]allber...@gmail.com
system administrator  [openafs,heimdal,too many hats]kf8nh
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk1LRsQACgkQIn7hlCsL25XSPACfRTlbLfBO6bKmg9EH4RPGSdMx
SvoAnjakFqCArV9GRczvi2b1HZ6BZTjO
=9Vvo
-END PGP SIGNATURE-

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: [Haskell-cafe] Work on Video Games in Haskell

2010-05-26 Thread Brandon S. Allbery KF8NH

On May 26, 2010, at 04:14 , David Virebayre wrote:

On Wed, May 26, 2010 at 9:58 AM, Brandon S. Allbery KF8NH
 wrote:

You might want to reread that license agreement.  Specifically:


Ah, yes. Ouch, that's abusive.
Can they tell the difference though ?



I suspect GHC-generated code is fairly distinctive even as machine  
code.  But they don't have to go to that extent; all they have to do  
is use Google to find this thread.  :(


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: [Haskell-cafe] Work on Video Games in Haskell

2010-05-26 Thread Brandon S. Allbery KF8NH

On May 26, 2010, at 03:50 , David Virebayre wrote:
On Wed, May 26, 2010 at 9:23 AM, Lyndon Maydwell  
 wrote:

As a side note, how is this project getting around the language
restrictions apple put in the developer license agreement?



From the project page :


This version uses Apple's official iPhone SDK as its back end  
compiler.


You might want to reread that license agreement.  Specifically:

"Applications must be originally written in Objective-C, C, C++, or
JavaScript as executed by the iPhone OS WebKit engine, and only code
written in C, C++, and Objective-C may compile and directly link
against the Documented APIs (e.g., Applications that link to
Documented APIs through an intermediary translation or compatibility
layer or tool are prohibited)"

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Re: [Haskell-cafe] ANN: hledger 0.8 released

2010-02-11 Thread Brandon S. Allbery KF8NH

On Feb 11, 2010, at 22:02 , Simon Michael wrote:

 * add: ctrl-d doesn't work on windows, suggest ctrl-c instead



Ctrl-Z would be the usual EOF in the Windows world, fwiw.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: GHC version 6.12.1

2009-12-15 Thread Brandon S. Allbery KF8NH

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Dec 15, 2009, at 06:13 , Dennis Walter wrote:

Where has Control.Concurrent.STM gone?
I cannot find it on
http://www.haskell.org/ghc/docs/latest/html/libraries/
anymore!


Split into an stm package, on hackage. :-)

Thanks for the info; I wonder if this is a good or a bad sign
regarding STM's future within Haskell? Is it so big and self-contained
to deserve its own external package, or is it so little used that it
does not belong to into the "standard" libraries? Did I miss an
announcement about restructuring and cleaning up the Haskell
hierarchical libraries?



What you missed is that the GHC devs are getting out of the libraries  
business.  The Haskell Platform replaces the GHC standard libraries.


- --
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH


-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.10 (Darwin)

iEYEARECAAYFAksoBZkACgkQIn7hlCsL25U/gQCfdasJwPAiKz1HMGZ1T3xcAXoG
c/4AoM6ZsbhpjNwpdCTkrRSmTCiaosy0
=lJ4Q
-END PGP SIGNATURE-
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: Announcing the new Haskell Prime process, and Haskell 2010

2009-07-07 Thread Brandon S. Allbery KF8NH

On Jul 7, 2009, at 11:40 , Claus Reinke wrote:
At last year's Haskell Symposium, it was announced that we would  
change the Haskell Prime process to make it less monolithic. ..
In the coming weeks we'll be refining proposals in preparation for  
Haskell 2010.


Given the incremental nature of the new standards, would it be
useful to switch back to version numbers, eg "Haskell 2.0.0 (2010)"
instead of "Haskell 2010"? Otherwise, we'll end up with half a
dozen more or less current Haskells related by no obvious means.
"Haskell'98" was chosen because it projected more permanence
than the Haskell 1.x line of Haskell revisions that came before it.


Arguably it was *too* successful at that.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: jhc 0.6.0 Haskell Compiler

2009-03-18 Thread Brandon S. Allbery KF8NH

On 2009 Mar 18, at 19:16, sylvain wrote:
Actually, times varie between runs. It tends to decrease (except for  
the

ghc generated binary), so I suppose it is due to OS cache effects.
Yet, I consistently observed that, according to "time", hello2 (jhc)
runs _faster_ than hello3 (gcc).

Something is wrong: how can Haskell be faster than C?


I suspect if you profile you'll find that Haskell's show is faster  
than C's printf, especially if the appropriate show instance is  
selected at compile time.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] string type class

2009-03-06 Thread Brandon S. Allbery KF8NH

On 2009 Mar 6, at 12:24, David Menendez wrote:

How about CharSequence?



I'd be tempted on first sight to assume that's related to Data.Seq.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] string type class

2009-03-06 Thread Brandon S. Allbery KF8NH

On 2009 Mar 6, at 11:13, Wolfgang Jeltsch wrote:

Am Freitag, 6. März 2009 13:33 schrieb Matthew Pocock:

It seems every time I look at hackage there is yet another stringy
datatype. For lots of apps, the particular stringy datatype you use  
matters
for performance but not algorithmic reasons. Perhaps this is a good  
time

for someone to propose a stringy class?


There is already the class IsString which was introduced for  
overloaded string

literals.

However, the name is terrible. No other Haskell class I know of has  
an “Is” at

its beginning. Classes don’t name properties (IsNum, IsMonoid, Has…).


But their proper names were available.  "String" is already taken for  
a concrete type, which complicates things; "IsString" was the simplest  
answer (and possibly avoided bikeshedding by being the answer nobody  
liked :)


Maybe you can also try to convince the masters of the IsString class  
to change
the class name. My previous attempts through mailing list e-mails  
seemed to

have no effect. :-(


I think the problem here is you need to get buy-in from everyone  
involved, which includes libraries@ (String), ghc (IsString is  
recognized in order to enable string overloading), ByteString, and  
potentially anyone who uses any of the above.  That said, if you want  
to officially propose it you need to read up on how to properly  
propose such changes to librar...@haskell.org.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com
system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu
electrical and computer engineering, carnegie mellon universityKF8NH




PGP.sig
Description: This is a digitally signed message part
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Perhaps a bug in GHC 6.10

2008-12-03 Thread Brandon S. Allbery KF8NH

On 2008 Dec 3, at 8:45, Krasimir Angelov wrote:

Sudoku.hs:269:5:
   Couldn't match expected type `Bool' against inferred type `a b'
   In the expression:
 ..

Surprisingly the same code is accepted from GHC 6.10. This looks like
a bug for me. The easiest way to reproduce this is to try to evaluate:



6.8.3 was changed on the theory that do "ought to" require a monad,  
contra Haskell98.  I suspect Haskell98 compatibility won.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Re: ANNOUNCE: GHC version 6.10.1 - MacOS installer

2008-11-04 Thread Brandon S. Allbery KF8NH

On 2008 Nov 4, at 20:26, Jason Dagit wrote:

On Tue, Nov 4, 2008 at 4:26 PM, Manuel M T Chakravarty
<[EMAIL PROTECTED]> wrote:

Jason Dagit:

I'm on OSX and I currently have ghc-6.6.1 and ghc-6.8.3 (installed
from a pkg). I would like to add ghc-6.10.1 to my system.  I tried  
to

do this with RC1 of 6.10, but I found that it uninstalled my
ghc-6.8.3.

What will I need to do to get both 6.8.3 and 6.10.1?


Are you sure it does deinstall the 6.8 compiler?  Or does it just  
overwrite

the symbolic links in /usr/bin?  To check, have a look at

/Library/Frameworks/GHC.framework/Versions

After installing 6.10, there should be a 608/ and a 610/  
directory.  This
certainly happens on my Mac and I am not aware of an option to  
change that

behaviour.


I haven't tried the 6.10.1 install, but after using the 6.8.3 pkg
followed by the 6.10 RC1 pkg, followed by the 6.8.3 pkg, I have just
608 in the directory you mention.


I expect if you used the OSX installer then /Library/Receipts is  
screwing you (it wipes the old files listed in the .bom file).  Try  
finding and removing the receipt directory and bom file before  
installing.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] How to get the binary respentation of the Int/Double.

2008-10-28 Thread Brandon S. Allbery KF8NH

On 2008 Oct 28, at 10:38, haihualin wrote:

I am wondering how to get the binary respentation of the Int/Double.
So I can save the integer as the binary data so that the C program  
can read it from the file.



The Binary package on Hackage (http://hackage.haskell.org) allows you  
to serialize Haskell data in any form including C-compatible binary  
output.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] IORef sharing

2008-10-27 Thread Brandon S. Allbery KF8NH

On 2008 Oct 27, at 20:25, Rodney D Price wrote:

Okay... However, when I use IO in a Haskell program,
the response is usually pretty snappy.  It's not as
if the Haskell runtime is hanging around, waiting for
some time in the future when it might be appropriate
to do IO.  It happens right now.  Yet the literature
gives the impression that the IO monad in particular
is a clever trick to preserve referential transparency
by gathering up all the IO actions, but not necessarily
actually *performing* them.  Then the Haskell runtime
holds its nose and *performs* them when necessary.0


The *conceptual* model for the IO monad is that "main" returns a big  
IO action which is then evaluated by the Haskell runtime.


As a practical matter, this usually behaves the same as if <- actually  
did evaluation.  (It doesn't.  It binds monadic expressions together,  
and is a convenient way to use the (>>=) operator.)  The one  
difference is its interaction with Haskell equations (a = b); since  
those are more or less macro definitions, assigning e.g. an expression  
of type IO String to such a "macro" will cause the expression to be  
substituted wherever the "macro" is used.


IO is a very atypical monad, by the way.  Someone pointed you earlier  
to the "IO Inside" page, which describes the internal tricks that make  
IO work.  I prefer to think of IO actions as partially applied  
functions, with the missing argument being a "RealWorld" that is  
hidden inside the IO monad.  (think:  IO a = State RealWorld a.  This  
isn't quite correct because the state also has IORefs inside it.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] IORef sharing

2008-10-27 Thread Brandon S. Allbery KF8NH

On 2008 Oct 27, at 19:02, Rodney D Price wrote:

My old, deeply flawed mental picture had "iio" taking
the role of a pointer to a value.  My bright, shiny
new mental picture has "iio" acting just like a C
#define macro: every time I call "iio", I'm really
just writing "newIORef 0".  Is that what you're saying?



Sort of.  What's really happening is that "newIORef" is an I/O action,  
just like "putStrLn", so will be executed every time it's used just as  
"putStrLn" is.


If you want to do it only once, you must do it only once and pass the  
resulting IORef around.  (There is also a way to do "global  
variables", but it's rather unsafe and requires telling the compiler  
to not rewrite the initialization code.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Probably a trivial thing for people knowing Haskell

2008-10-19 Thread Brandon S. Allbery KF8NH

On 2008 Oct 19, at 11:25, Friedrich wrote:

Ok to  be more concrete is the laziness "hidden" here?

check_line line sum count =
   let match = matchRegex regexp line
   in case match of
  Just strs -> (sum + read (head strs) :: Integer, count  
+ 1)

  Nothing -> (sum, count)



For starters, "let" is lazy.  "case" is strict to the extent that it  
has to evaluate enough to decide if the result is Just or Nothing, but  
that's useless if the code leading up to its application is lazy.  I  
don't know how lazy matchRegex is, if it is lazy enough then all that  
gets evaluated by the case is just enough to know if the result is  
Just or Nothing but not the value of "strs".  (One obvious possibility  
is that it determines that there *are* strings, but not what they  
are.)  Everything else is automatically lazy.


So, unless the caller forces the result of this function, you are very  
likely to end up with a chain of partially evaluated matches that  
don't get resolved until the result is printed.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Probably a trivial thing for people knowing Haskell

2008-10-19 Thread Brandon S. Allbery KF8NH

On 2008 Oct 19, at 11:24, Friedrich wrote:

"Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]> writes:

The relationship
between types and proofs is especially obvious in Haskell.  And  
proofs

aren't merely mathematical entities, they're expressions of what you
want to accomplish:  if you can type your program, you have a high
likelihood not only that it will compile, but that it will do what  
you

intend.

Well I could argue with the types in C and would not come along very
far. In the TCP/IP stuff one can see what you have to do,  sooner or


From a Haskell standpoint, C and Java are virtually untyped.

If you want to see types => programs in action, play around with the  
@free and @djinn commands in lambdabot (a Haskell bot that lives on  
FreeNode).  @free treats a type as a theorem and produces a "proof" of  
it in Haskell code; @djinn takes a function declaration (type -> type)  
and generates the "obvious" code suggested by the declaration.   
(@djinn is sadly somewhat limited; it doesn't handle recursive types,  
so e.g. lists don't work too well.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Probably a trivial thing for people knowing Haskell

2008-10-19 Thread Brandon S. Allbery KF8NH

On 2008 Oct 19, at 11:18, Friedrich wrote:

"Brandon S. Allbery KF8NH" <[EMAIL PROTECTED]> writes:

On 2008 Oct 19, at 2:07, Friedrich wrote:

Howerver even if Strings are bad I can not see why they are hanging
around so long. I open a file a read it line by line and I close the
file so all read string are "garbage" and getting rid of them should
not be that hard or should it?


If your code is too lazy, you have the whole file + the close
operation hanging around in unevaluated thunks until you print the
result and it all gets processed all at once.  Laziness is a double-
edged sword.

Where in my code is this laziness hidden? Is it while recurions with
sum and count?



That would be my guess, although I'd have to examine the Core  
(intermediate compilation stage) to be certain.  Others here are  
better at looking at Haskell code and seeing where the laziness  
"leaks" are.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Probably a trivial thing for people knowing Haskell

2008-10-19 Thread Brandon S. Allbery KF8NH

On 2008 Oct 19, at 2:26, Friedrich wrote:

Paul Johnson <[EMAIL PROTECTED]> writes:

(By the way, putting in the top level type declarations helps a lot

when you make a mistake.)

Well I have my problems with that. Probably it comes from using
Languages like Ruby and my special dislike of "typing things" comes
especially from Java, C++ (well C is not "innocent" in that regard
also.


Learn to love types:  one of the neat things about Haskell is that if  
you can write down the type of a function then you have usually done  
90% of the work of writing the code for it.  Another is that in  
general, if you can't express the type of a function, it means you  
haven't thought through what you're trying to do.  The relationship  
between types and proofs is especially obvious in Haskell.  And proofs  
aren't merely mathematical entities, they're expressions of what you  
want to accomplish:  if you can type your program, you have a high  
likelihood not only that it will compile, but that it will do what you  
intend.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Probably a trivial thing for people knowing Haskell

2008-10-19 Thread Brandon S. Allbery KF8NH

On 2008 Oct 19, at 2:07, Friedrich wrote:

Howerver even if Strings are bad I can not see why they are hanging
around so long. I open a file a read it line by line and I close the
file so all read string are "garbage" and getting rid of them should
not be that hard or should it?



If your code is too lazy, you have the whole file + the close  
operation hanging around in unevaluated thunks until you print the  
result and it all gets processed all at once.  Laziness is a double- 
edged sword.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: on starting Haskell-Edu, a new education-related Haskell-related mailing list

2008-07-11 Thread Brandon S. Allbery KF8NH


On 2008 Jul 11, at 11:33, Neil Mitchell wrote:


Quite true.  Any objections to [EMAIL PROTECTED]


Google suggests that about 1 in 50 web pages spell "beginner" wrong,
using only one "n". Given that many Haskeller's are not native
speakers, could we perhaps pick something that is easier to spell
correctly?



Stealing a page from FreeBSD:  [EMAIL PROTECTED] ?

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: on starting Haskell-Edu, a new education-related Haskell-related mailing list

2008-07-11 Thread Brandon S. Allbery KF8NH


On 2008 Jul 11, at 9:54, Jonathan Cast wrote:


On Fri, 2008-07-11 at 08:47 -0400, Chad Wilson wrote:

From previous experience with this sort of thing (the expansion of

usage for a list(s)), I am thinking you guys have entered a territory
better served by a forum.  One subscription gets you access to the

If the mail interface disappears, so will I.  I have never seen a  
worth-while web discussion interface.  Ever.



Agreed with a caveat:  I want the ability to track the forum with  
either email summaries (preferred) or an RSS feed; having to manually  
check a web site periodically sucks and is an additional time sink I  
can't really afford, and will de facto result in my leaving the  
community.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] [Haskell-cafe] Help with polymorphic functions

2008-05-09 Thread Brandon S. Allbery KF8NH


On 2008 May 9, at 8:28, Abhay Parvate wrote:

Of course in the final code many people would recommend that you put  
in the type declarations as a good form of documentation, and it may  
be also more specialized  according to your usage than what the  
compiler/interpreter will deduce.



It's also useful to include them because it helps localize other type  
errors; if you leave type inference to the compiler, a type error will  
be reported when it is discovered, which may be far from where the  
actual error is.  You end up having to trace back through the  
definitions of functions used in the failing expression to find where  
the actual type error is.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Re: [Haskell-cafe] ANNOUNCE: Generic Haskell 1.80 (Emerald)

2008-04-12 Thread Brandon S. Allbery KF8NH


On Apr 12, 2008, at 13:33 , Thomas van Noort wrote:

On 12/04/2008, Thomas van Noort <[EMAIL PROTECTED]> wrote:


That's a good question. Unfortunately, only Haskell98 types are
currently
 supported by the Generic Haskell compiler.


I thought constrained types were Haskell 98, but now I'm in doubt...


language. Generic Haskell is fully reflexive with respect to the types
that are definable in Haskell 98, except for constraints in data-type
definitions. So a data type of the form

data Eq a => Set a = NilSet | ConsSet a (Set a)

is not dealt with correctly. However, constrained data types are a  
corner

case in Haskell and can easily be simulated using other means.


I was under the impression "corner case" here means that H98 lets you  
write it but doesn't handle it very sanely (a GHC-specific extension  
being needed to achieve that).


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Extensible records: Static duck typing

2008-02-08 Thread Brandon S. Allbery KF8NH

[hm.  should this discussion move to -cafe?]

On Feb 8, 2008, at 20:15 , Jonathan Cast wrote:


On 8 Feb 2008, at 4:43 PM, Dan Weston wrote:


Ouch. How would a human parse [apple'*'pear]


In this context, `parse error, tricky syntax'.


I kinda have that problem anyway given ' being permitted in  
identifiers at all.  Given that I expect it now, the above isn't a  
whole lot worse (I've already parsed (token "apple'") when I hit the  
(token "*'"), the only question is whether the extension in use  
attaches the ' to the operator or to the following identifier.


(Although I would assume the latter if I ran into it without prior  
knowledge, based on ' normally being a word-identifier character when  
it can't be a Char literal.)


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: Trying to install binary-0.4

2007-10-14 Thread Brandon S. Allbery KF8NH


On Oct 14, 2007, at 12:48 , Ian Lynagh wrote:


On Sun, Oct 14, 2007 at 05:19:31PM +0200, Udo Stenzel wrote:

Ian Lynagh wrote:
People interested in making it easy to use new versions of  
packages with
old compiler releases can make a small script that installs empty  
Cabal

packages called bytestring, containers, array, etc.


That completely misses the fact that bytestring cannot be  
upgraded, no

matter how many fake packages are available.


Ah, you mean the problem is that it really does depend on some  
change in
bytestring (the internal API?), rather than just having a  
dependency on

the bytestring package?


I think dons has said that the latest bytestring depends on some GHC  
6.8 internals that can't reasonably be backported, so if you need the  
new bytestring API, you're kinda stuck.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] (no subject)

2007-09-05 Thread Brandon S. Allbery KF8NH


On Sep 5, 2007, at 21:10 , Tomi Owens wrote:


Prelude> let f (a,b) = a * floor (10/b)
Prelude> f(2,5)
4

This function works just as I want it to.

Now I try creating a list:

Prelude> [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a]
[(2,1),(5,2),(8,2),(10,3),(13,3),(18,3),(17,4)]

and this works
So now I try to apply the function to the list:

Prelude> map (f) [(a2+b2,a)| a <- [1..4] , b<- [1..4], a2+b2<20, b<=a]

and I get this result:

:1:5:
   Ambiguous type variable `t' in the constraints:
 `Integral t' arising from use of `f' at :1:5
 `RealFrac t' arising from use of `f' at :1:5
   Probable fix: add a type signature that fixes these type variable 
(s)



I'm sorry, but I don't quite get how to set the type signature and  
how it will apply to my function...


The problem here is that (assuming the a\sup{2} etc. are actually  
a^2) the (^) operator expects and returns Integrals, but (/) requires  
a RealFrac.  Thus, the type of your list comprehension is inferred to  
be [(Integer,Integer)] but needs to be RealFrac a => [(Integer,a)]  
(or, more simply, [(Integer,Double)].


  Prelude> let f (a,b) = a * floor (10/b)
  Prelude> :t f
  f :: (RealFrac t1, Integral t) => (t, t1) -> t
  Prelude> let v :: [(Integer,Double)]; v = [(a^2 + b^2,fromIntegral  
a) | a <- [1..4], b <- [1..4], a^2 + b^2 < 20, b <= a]

  Prelude> :t v
  v :: [(Integer, Double)]
  Prelude> map f v
  [20,25,40,30,433329,54,425000]

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ST vs State

2007-05-30 Thread Brandon S. Allbery KF8NH


On May 30, 2007, at 5:59 , Federico Squartini wrote:


I suppose there is something "under the hood" which makes them
different, but I cannot figure out what.


For one thing, ST uses existential types to prevent values from  
leaking outside the monad.


--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH


___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Is Hackage becoming a centralistic approach?

2007-05-03 Thread Brandon S. Allbery KF8NH


On May 3, 2007, at 13:47 , Wolfgang Jeltsch wrote:

on  I read that there is  
the idea to
make Hackage support bug tracking and project pages.  This looks  
like Hackage
should provide complete hosting of Haskell projects at some time.   
Is this
really intended?  Since any reasonable Haskell project should use  
Hackage
now, this would mean that a Haskell software developer cannot use  
another
hosting provider or whatever to host his project.  I think this  
would be very
bad since the decision about how and where to host a project  
shouldn’t be

based primarily on what programming language it uses.


My understanding is that yes, it will offer hosting eventually; but  
this will be an option, not a requirement.  Many people don't have  
readily available hosting options, so this would make it easier for  
them to contribute.


--
brandon s. allbery  [solaris,freebsd,perl,pugs,haskell]   
[EMAIL PROTECTED]
system administrator  [openafs,heimdal,too many hats]   
[EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon university   
KF8NH



___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Fast Packed Strings Question

2007-01-07 Thread Brandon S. Allbery KF8NH


On Jan 7, 2007, at 14:30 , Dominic Steinitz wrote:


Data/Digest/SHA1.hs:36:17:
   Could not find module `Data.ByteString':
 it was found in multiple packages: fps-0.8 base

What's the story with fast packed strings these days?

Is it now part of base and I shouldn't have installed it? If not,  
can someone remind me how I hide the module in base?


Yes, it's in base-2.0 (GHC 6.6).

ghc-pkg unregister fps-0.8

--
brandon s. allbery[linux,solaris,freebsd,perl] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH



___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] (CLARIFICATION) ghci readline support on FreeBSD: simple patch

2006-12-31 Thread Brandon S. Allbery KF8NH


On Dec 31, 2006, at 8:28 , Brandon S. Allbery KF8NH wrote:

The problem people have been having with ghci on FreeBSD turns out  
to be a bootstrapping issue: (...)


There seems to be a little confusion about this, from discussions on  
the IRC channel and in private mail; my apologies, I was insomniac  
while sending that message, and was less than clear as a result.


This is not a GHC bug; it's a problem with the way the FreeBSD  
"ports" infrastructure is using the bootstrap compiler.  (And my  
problem statement was slightly incorrect, it turns out; the bootstrap  
ghc-pkg is there, but is not where ghc/configure can see it.)


My patch is not a fix; it's a quick hack that stubs out the failing  
configure test, and is very much not suitable for official  
distribution.  A better fix is to use the bootstrap ghc-pkg, but  
there are complications (in particular, the bootstrap wants a libgmp  
shared library; I'm failing to understand why the final build isn't  
using a libgmp.so at all, or how the bootstrap ghc is getting around  
the same issue).


I've since checked the FreeBSD bug database for outstanding bugs  
against the lang/ghc port, and determined that neither this problem  
nor an update to GHC 6.6 are in the queue.  I've filed a proper bug  
report (detailing the actual problem and suggesting possible (actual,  
as opposed to my hack) fixes, leaving it up to the port maintainer to  
decide how to fix it properly).


I am undecided as to whether to follow up with an update to GHC 6.6.   
There are some complications here as well:


* FreeBSD ports is currently in "slush" (not quite a freeze...)  
pending 6.2-RELEASE, and will likely remain so for the next few weeks  
due to unexpected delays in the release process;
* I'll probably have to work out that proper fix for the readline  
issue first, instead of leaving it to the maintainer;
* Since GHC 6.6 is not fully backward compatible with 6.4.2, updating  
will probably require requesting a repocopy of lang/ghc to lang/ 
ghc642 and updating ports depending on it to point to the copy, then  
filing update bug reports against those dependents.  This is probably  
better handled by the port maintainer, given ports update protocols.


Given the above, probably I'll just request that the maintainer  
update the port when convenient.


--
brandon s. allbery[linux,solaris,freebsd,perl] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH



___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ghci readline support on FreeBSD: simple patch

2006-12-31 Thread Brandon S. Allbery KF8NH
The problem people have been having with ghci on FreeBSD turns out to  
be a bootstrapping issue:  if the bootstrap compiler was not built  
with readline support, or it doesn't include ghc-pkg (the FreeBSD  
bootstrap ghc has been stripped down to bare essentials, so guess  
what's not there?), then ghc won't be built with readline support  
unless you build the stage2 and stage3 compilers.  Since ports only  
builds stage1, with the crippled bootstrap ghc, the result is no  
readline in ghc itself.  (But the readline package is built, so  
Haskell programs which themselves use readline work fine.)


The attached patch is a simplistic, hacky workaround which stubs out  
the offending configure test.  Since ports ghc declares readline as a  
dependency, this is safe (or at least safe enough).  Drop it into / 
usr/ports/lang/ghc/files and (re)build ghc (either "cd /usr/ports/ 
lang/ghc; make install clean -DFORCE_PKG_REGISTER", or "portupgrade - 
f ghc", or deinstall and reinstall from scratch).  You will probably  
want to do something to keep it from being removed or to copy it back  
when you update the ports tree with portsnap or cvsup.


I'm not going to bother reporting this to the port maintainer because  
it'll just get stuck in the same queue that's holding the ghc-6.6  
upgrade.  :)


--
brandon s. allbery[linux,solaris,freebsd,perl] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH



patch-local-ghc_configure
Description: Binary data



___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Re: GHCi and Hugs ASCII logos

2006-12-27 Thread Brandon S. Allbery KF8NH


On Dec 27, 2006, at 12:36 , Jason Mobarak wrote:


Nathan Mishra Linger wrote:

Dear Haskellers,
I think I remember that some program was used to generate either  
the Hugs or GHCi ascii logo that appears when you fire up the  
interpreter.
__   __ __  __     ___   ||   || ||   
|| ||  || ||_____ ___ _  ||___|| ||__|| ||__||   
__||  / _ \ /\  /\/ __(_)  ||---|| ___||   / /_ 
\// /_/ / /  | | ||   ||/ /_\\/ __  / /___| |
||   || Version: March 2005\/\/ /_/\/|_| (view with a  
fixed width font)
Where can I find this program?  I used to know, but can't remember  
and can't seem to get Google to tell me.


M-x artist-mode


Something like "figlet", I imagine.

--
brandon s. allbery[linux,solaris,freebsd,perl] [EMAIL PROTECTED]
system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED]
electrical and computer engineering, carnegie mellon universityKF8NH



___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell