[Haskell-cafe] How large is the Haskell community ?

2011-02-12 Thread Aaron Gray
I was wondering if anyone had an idea or estimate as to how large the
Haskell community is ?

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How large is the Haskell community ?

2011-02-12 Thread Aaron Gray
On 12 February 2011 20:24, Don Stewart d...@galois.com wrote:

 aaronngray.lists:
 I was wondering if anyone had an idea or estimate as to how large the
 Haskell community is ?

 No one knows. There are many figures that you could use to estimate the
 size (e.g. I try to gather signifcant stats in yearly reports about
 Hackage)

  * In 2010, for example, 138,000 unique IPs downloaded the Haskell
 Platform.

http://www.galois.com/~dons/talks/hiw-hackage-y2.pdf


Right 138,000, but that would not account for gateways :|

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How large is the Haskell community ?

2011-02-12 Thread Aaron Gray
On 12 February 2011 21:31, Erik de Castro Lopo mle...@mega-nerd.com wrote:

 Aaron Gray wrote:

  On 12 February 2011 20:24, Don Stewart d...@galois.com wrote:
 
   aaronngray.lists:
   I was wondering if anyone had an idea or estimate as to how large
 the
   Haskell community is ?
  
   No one knows. There are many figures that you could use to estimate the
   size (e.g. I try to gather signifcant stats in yearly reports about
   Hackage)
  
* In 2010, for example, 138,000 unique IPs downloaded the Haskell
   Platform.
  
  http://www.galois.com/~dons/talks/hiw-hackage-y2.pdf
  
  
  Right 138,000, but that would not account for gateways :|

 Or people who get Haskell related stuff via their Linux distribution
 (specifically Debian, Ubuntu and Fedora, but possibly others as well).


Then there are people who download it, look at it and maybe find it too
complex to use ?

I am wondering if mailing list statistics would be the best guide ?

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] How large is the Haskell community ?

2011-02-12 Thread Aaron Gray
On 12 February 2011 23:57, Jan Christiansen j...@informatik.uni-kiel.dewrote:


 On 12.02.2011, at 21:18, Aaron Gray wrote:

  I was wondering if anyone had an idea or estimate as to how large the
 Haskell community is ?


 All the answers made me wonder what the criterion is to be a member of the
 Haskell community. Are you a member if you downloaded ghc, if you have (at
 least once) defined a Monad instance, if you have written a hackage package,
 if you have contributed to the Monad.Reader, if you have a github account
 with at least one Haskell project, if you read at least one of the haskell
 mailing lists, if you contribute to a haskell mailing list (perhaps on a
 regular basis), if you post on reddit, if you answer/ask questions on
 stackoverflow, if you have written at least 1 lines of code in Haskell,
 if Haskell is one of the programming languages you use, if Haskell is the
 one programming language you use, if you have written a PhD thesis related
 to Haskell, if you have asked a type related question only Oleg Kiselyov was
 able to answer, if you know what a Monoid is and know how to use it ... ; )

 Cheers, Jan


Maybe we should have some website like the Linux Counter where you can get
an official Haskell user number ?

Then advertise it well.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] A few days to go before the old server goes down

2011-01-30 Thread Aaron Gray
On 27 January 2011 22:42, Henk-Jan van Tuyl hjgt...@chello.nl wrote:


 L.S.,

 Only four days until the old Haskell.org server disappears; I found the
 following missing:

 http://www.haskell.org/yale/
 http://darcs.haskell.org/hfuse/
 http://haskell.org/gtk2hs/
 http://haskell.org/FranTk
 http://www.haskell.org/yampa/
 http://www.haskell.org/visualhaskell/

 http://haskell.org/~kolmodin
 http://haskell.org/graphics/
 http://www.haskell.org/libraries/
 http://haskell.org/hdirect/
 http://haskell.org/haskore/
 http://darcs.haskell.org/wxhaskell/
 http://www.haskell.org/all_about_monads
 http://www.haskell.org/edsl/
 http://www.haskell.org/jcp/
 http://darcs.haskell.org/yaht
 http://cvs.haskell.org/darcs/
 http://haskell.org/ObjectIO
 http://www.haskell.org/sitewiki/
 http://darcs.haskell.org/~lemmih/

 It would also be a shame if useful information would be lost, so copy the
 pages before it is too late! (The Wayback Machine has no recent copies, or
 even none at all for some pages.)

 If they have moved, it would be useful to know whereto, as several
 HaskellWiki pages have to be updated.

 Regards,
 Henk-Jan van Tuyl


There also seems to be missing darcs repositories on :-

code.haskell.org

these do not seem to be accessible on :-

code.oldhaskell.cs.yale.edu

Is it possible to delay the switch off and to get the missing sub domains
on oldhaskell.cs.yale.edu reinstated ?

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Tracing applied functions

2011-01-24 Thread Aaron Gray
Is there anyway to get a list of applied functions in the running of a
Haskell program ?

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Tracing applied functions

2011-01-24 Thread Aaron Gray
On 24 January 2011 23:01, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.comwrote:

 On 25 January 2011 02:55, Aaron Gray aaronngray.li...@gmail.com wrote:
  Is there anyway to get a list of applied functions in the running of a
  Haskell program ?

 Profile it?


Okay, How do I do that ?

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Tracing applied functions

2011-01-24 Thread Aaron Gray
On 25 January 2011 02:12, Ivan Lazar Miljenovic
ivan.miljeno...@gmail.comwrote:

 On 25 January 2011 12:05, Aaron Gray aaronngray.li...@gmail.com wrote:
  On 24 January 2011 23:01, Ivan Lazar Miljenovic 
 ivan.miljeno...@gmail.com
  wrote:
 
  On 25 January 2011 02:55, Aaron Gray aaronngray.li...@gmail.com wrote
   Is there anyway to get a list of applied functions in the running of a
   Haskell program ?
 
  Profile it?
 
  Okay, How do I do that ?

 http://www.haskell.org/haskellwiki/How_to_profile_a_Haskell_program
 http://book.realworldhaskell.org/read/profiling-and-optimization.html


Thanks I will have a look at those in the morning.

Aaron


  --
 Ivan Lazar Miljenovic
 ivan.miljeno...@gmail.com
 IvanMiljenovic.wordpress.com

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


Re: [Haskell-cafe] Data.Ranges show error

2011-01-22 Thread Aaron Gray
On 22 January 2011 13:15, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Saturday 22 January 2011 03:47:55, Aaron Gray wrote:
  Data.Ranges.hs:12
 
  show (Range x y) = concat [(, show x, –, show y, )]
 
  Contains the following charcter sequence :-
 
  –
 
  Which does not seem to be supported in Windows codepage.
 
  Aaron

 For me, that's an en-dash (U+2013 / '\8211').
 I believe something on your box mangled the UTF-8 encoding.


Weird I did a cabal install and have not touched it with an editor.

Are you on Windows ?

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Flushing Cabal's cache

2011-01-22 Thread Aaron Gray
I am getting the following error :-

C:\Languages\Lexer\Haskellcabal install ranges
Resolving dependencies...
cabal: Error: some packages failed to install:
ranges-0.2.3 failed while unpacking the package. The exception was:
user error (TAR checksum error)

I am on Windows Vista, is it possible to clean or delete Cabal's cache ?

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Data.Ranges show error

2011-01-22 Thread Aaron Gray
On 22 January 2011 16:31, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Saturday 22 January 2011 17:01:00, Aaron Gray wrote:
  
   For me, that's an en-dash (U+2013 / '\8211').
   I believe something on your box mangled the UTF-8 encoding.
 
  Weird I did a cabal install and have not touched it with an editor.

 Except to look at it trying to find the issue, I suppose (how else did you
 find the –)?


I downloaded it separately from the HackageDB.


 What's your locale?
 Could also be that GHC tries to interpret UTF-8 in your locale and barfs on
 that.


Not sure ? Vista's default.



 
  Are you on Windows ?

 No, linux.


Ah

How do I get Cabal to install a package from disk rather than from the
internet ?

Many thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Data.Ranges show error

2011-01-22 Thread Aaron Gray
On 22 January 2011 17:04, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Saturday 22 January 2011 17:42:39, Aaron Gray wrote:
   What's your locale?
   Could also be that GHC tries to interpret UTF-8 in your locale and
   barfs on that.
 
  Not sure ? Vista's default.
 

 Which probably isn't UTF-8. There must be an analogue of locale on Windows
 to check.


Not sure I thought it was UTF-8.

Its behaving differently on different Vista machines.


 Are you on Windows ?
  
   No, linux.
 
  Ah
 
  How do I get Cabal to install a package from disk rather than from the
  internet ?

 If it's unpacked, just cd into the package directory and do a

 $ cabal install

 there (optionally provide further command line args, but not the package
 name)

 or

 $ runghc ./Setup.hs configure --user
 $ runghc ./Setup.hs build
 $ runghc ./Setup.hs install

 If it's a .tar.gz, I don't know if cabal already supports installing those
 from a specified location (i.e., not from hackage or its cache).


Thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Data.Ranges show error

2011-01-21 Thread Aaron Gray
I am getting the following error when trying to do a show on a Ranges object
:-

C:\Languages\Haskellghci rangeTest.hs
GHCi, version 6.12.3: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
[1 of 1] Compiling Main ( rangeTest.hs, interpreted )
Ok, modules loaded: Main.
*Main main
Loading package array-0.3.0.1 ... linking ... done.
Loading package containers-0.3.0.0 ... linking ... done.
Loading package ranges-0.2.3 ... linking ... done.
Ranges [(37*** Exception: stdout: hPutChar: invalid argument (character is
not
 in the code page)
*Main

I have attached the test source also :-

import Data.Ranges

test = (ranges [
range 32 33,
range 34 35,
range 37 39
])


main :: IO ()
main = do {
putStrLn (show test)
}

I am probably doing something fundermentaly wrong.

Many thanks in advance,

Aaron


rangeTest.hs
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-11 Thread Aaron Gray
On 11 January 2011 00:02, Antoine Latter aslat...@gmail.com wrote:

 On Mon, Jan 10, 2011 at 5:23 PM, Aaron Gray aaronngray.li...@gmail.com
 wrote:
  On 10 January 2011 22:30, Henning Thielemann 
 lemm...@henning-thielemann.de
  wrote:
 
  John Lato schrieb:
 
   You could use my word24 package[1] (GHC only) to provide non-aligned
   24-bit word and int types with Storable instances.  You should be able
   to write a binary instance (or whatever blaze-builder needs) fairly
   simply from this.  Little-endian only ATM, but BE could be added if
   necessary.
 
  Good to know that! However, I think for the original poster the binary
  package is perfect. This way he does not worry about unsafe peeking and
  poking around in memory.
 
 
  Yes. I have came back to looking at the binary package, the only thing is
 I
  think I have to build my own primatives with it as it is big-endian,
 where
  ActionScript Byte Code format is little-endian. It does provide some
  little-endian functions but they are not brought to the surface. It also
  seems to roll its own serializations.

 The 'binary' package supports big-endian, little-endian and
 host-endian construction in the Data.Binary.Builder module, so you
 hopefully won't need to reimplement too much.


Are there any examples of usage anywhere ? It does not seem to have 24bit
values either.

I am still thinking of implementing my own following the straight
Data.Binary package as an example.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-11 Thread Aaron Gray
On 11 January 2011 18:54, Antoine Latter aslat...@gmail.com wrote:

 On Tue, Jan 11, 2011 at 10:22 AM, Aaron Gray aaronngray.li...@gmail.com
 wrote:
  On 11 January 2011 00:02, Antoine Latter aslat...@gmail.com wrote:
 
  On Mon, Jan 10, 2011 at 5:23 PM, Aaron Gray aaronngray.li...@gmail.com
 
  wrote:
   On 10 January 2011 22:30, Henning Thielemann
   lemm...@henning-thielemann.de
   wrote:
  
   John Lato schrieb:
  
You could use my word24 package[1] (GHC only) to provide
non-aligned
24-bit word and int types with Storable instances.  You should be
able
to write a binary instance (or whatever blaze-builder needs) fairly
simply from this.  Little-endian only ATM, but BE could be added if
necessary.
  
   Good to know that! However, I think for the original poster the
 binary
   package is perfect. This way he does not worry about unsafe peeking
 and
   poking around in memory.
  
  
   Yes. I have came back to looking at the binary package, the only thing
   is I
   think I have to build my own primatives with it as it is big-endian,
   where
   ActionScript Byte Code format is little-endian. It does provide some
   little-endian functions but they are not brought to the surface. It
 also
   seems to roll its own serializations.
 
  The 'binary' package supports big-endian, little-endian and
  host-endian construction in the Data.Binary.Builder module, so you
  hopefully won't need to reimplement too much.
 
 
  Are there any examples of usage anywhere ? It does not seem to have 24bit
  values either.
  I am still thinking of implementing my own following the straight
  Data.Binary package as an example.
  Aaron
 

 I used Data.Binary.Builder in an implementation of the memcached
 binary protocol:

 http://hackage.haskell.org/packages/archive/starling/0.3.0/doc/html/Network-Starling-Core.html


Nice code, I like the Serialize and Deserialize classes. Its a
shame Data.Binary does not use them.


 I'm sure other folks can chime in with good examples if that one isn't
 clear - the package 'binary' is pretty popular.

 You'd have to write your own putWord24be/le or whatever you need out
 of the 'singleton :: Word8 - Builder' function. But that seems
 simpler than reimplementing Data.Binary.


Yes.

Thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-10 Thread Aaron Gray
On 10 January 2011 13:49, John Lato jwl...@gmail.com wrote:

 From: Aaron Gray aaronngray.li...@gmail.com

 On 9 January 2011 21:30, Henning Thielemann
 lemm...@henning-thielemann.dewrote:

 
  On Sun, 9 Jan 2011, Aaron Gray wrote:
 
   I am trying to work out how to use GHC.Ptr, Foreign.Storable,
  Data.Storable.Endian, and
  am looking for good examples of usage.
 
 
  What do you intend to do with them?
 
 
 An (ABC) ActionScript Byte Code backend for Haskell.

 Basically I need to write little-endian binary to a file, and was
 wondering
 the best way to do this; I need various types including a 24bit type.


 You could use my word24 package[1] (GHC only) to provide non-aligned
 24-bit word and int types with Storable instances.  You should be able to
 write a binary instance (or whatever blaze-builder needs) fairly simply from
 this.  Little-endian only ATM, but BE could be added if necessary.

 John Lato
 [1] http://hackage.haskell.org/package/word24


This is interesting, what does the following line do :-

data Int24 = I24# Int# deriving (Eq, Ord)

regarding the I24# and Int#, are these inbuilt ?

Thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-10 Thread Aaron Gray
On 10 January 2011 16:13, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Monday 10 January 2011 16:45:36, Aaron Gray wrote:
 
  This is interesting, what does the following line do :-
 
  data Int24 = I24# Int# deriving (Eq, Ord)
 
  regarding the I24# and Int#, are these inbuilt ?

 Int# is the raw machine int (4 or 8 bytes) and I24# is the constructor. GHC
 uses the magic hash '#' to denote raw unboxed types (and the constructors
 making ordinary boxed Haskell types from these, e.g. there's

 data Int = I# Int#
 data Word = W# Word#
 data Double = D# Double#

 and more defined in base [GHC.Types, GHC.Word]).


So the 24 bit value is actually stored as a 32bit value. Meaning I will have
to do my own IO reader and writer code to a ByteString.

Thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-10 Thread Aaron Gray
On 10 January 2011 16:36, Antoine Latter aslat...@gmail.com wrote:

 On Mon, Jan 10, 2011 at 10:17 AM, Aaron Gray aaronngray.li...@gmail.com
 wrote:
  On 10 January 2011 16:13, Daniel Fischer 
 daniel.is.fisc...@googlemail.com
  wrote:
 
  On Monday 10 January 2011 16:45:36, Aaron Gray wrote:
  
   This is interesting, what does the following line do :-
  
   data Int24 = I24# Int# deriving (Eq, Ord)
  
   regarding the I24# and Int#, are these inbuilt ?
 
  Int# is the raw machine int (4 or 8 bytes) and I24# is the constructor.
  GHC
  uses the magic hash '#' to denote raw unboxed types (and the
 constructors
  making ordinary boxed Haskell types from these, e.g. there's
 
  data Int = I# Int#
  data Word = W# Word#
  data Double = D# Double#
 
  and more defined in base [GHC.Types, GHC.Word]).
 
  So the 24 bit value is actually stored as a 32bit value. Meaning I will
 have
  to do my own IO reader and writer code to a ByteString.
  Thanks,
  Aaron
 

 I don't think so - the Storable instance provided for the Int24 type
 peeks and pokes 24-bit values. At least, that what I understand John's
 earlier message to mean.


Yes looking at the code it does support 24bit peeks and pokes.

Thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-10 Thread Aaron Gray
On 10 January 2011 22:30, Henning Thielemann
lemm...@henning-thielemann.dewrote:

 John Lato schrieb:

  You could use my word24 package[1] (GHC only) to provide non-aligned
  24-bit word and int types with Storable instances.  You should be able
  to write a binary instance (or whatever blaze-builder needs) fairly
  simply from this.  Little-endian only ATM, but BE could be added if
  necessary.

 Good to know that! However, I think for the original poster the binary
 package is perfect. This way he does not worry about unsafe peeking and
 poking around in memory.


Yes. I have came back to looking at the binary package, the only thing is I
think I have to build my own primatives with it as it is big-endian, where
ActionScript Byte Code format is little-endian. It does provide some
little-endian functions but they are not brought to the surface. It also
seems to roll its own serializations.

I am maybe looking at doing my own specialized set of types and binary
backend as there are drawback with each of the existing solutions.

  - Data.Storable.Endian - peeks and pokes rather than put/get
  - Data.Word24 - peeks and pokes rather than put/get
  - Data.Binary - big-endian

ABC format may best be supported by a specific set of serialization types.

On a different note thinking outside this problem, I would like IO_LE and
IO_BE types if that could be make to work.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
Hi,

I am trying to work out how to use GHC.Ptr, Foreign.Storable,
Data.Storable.Endian, and am looking for good examples of usage.

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
On 9 January 2011 22:34, Henk-Jan van Tuyl hjgt...@chello.nl wrote:

 On Sun, 09 Jan 2011 14:48:09 +0100, Aaron Gray aaronngray.li...@gmail.com
 wrote:

  Hi,

 I am trying to work out how to use GHC.Ptr, Foreign.Storable,
 Data.Storable.Endian, and am looking for good examples of usage.

 Many thanks in advance,

 Aaron


 You can lookup, which packages use these, by looking at the reverse
 dependencies:

 http://bifunctor.homelinux.net/~roel/hackage/packages/archive/pkg-list.html

 Handy I did not notice that, nice.

Thanks,

Aaron



 Regards,
 Henk-Jan van Tuyl


 --
 http://Van.Tuyl.eu/
 http://members.chello.nl/hjgtuyl/tourdemonad.html
 --

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


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
On 9 January 2011 21:30, Henning Thielemann
lemm...@henning-thielemann.dewrote:


 On Sun, 9 Jan 2011, Aaron Gray wrote:

  I am trying to work out how to use GHC.Ptr, Foreign.Storable,
 Data.Storable.Endian, and
 am looking for good examples of usage.


 What do you intend to do with them?


An (ABC) ActionScript Byte Code backend for Haskell.

Basically I need to write little-endian binary to a file, and was wondering
the best way to do this; I need various types including a 24bit type.


 The package storablevector uses a lot of Ptr, peek, and poke. Maybe this is
 of some help.


Okay thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] GHC.Ptr, Foreign.Storable, Data.Storable.Endian, looking for good examples of usage

2011-01-09 Thread Aaron Gray
On 10 January 2011 01:08, Antoine Latter aslat...@gmail.com wrote:

 On Sun, Jan 9, 2011 at 6:05 PM, Aaron Gray aaronngray.li...@gmail.com
 wrote:
  On 9 January 2011 21:30, Henning Thielemann 
 lemm...@henning-thielemann.de
  wrote:
 
  On Sun, 9 Jan 2011, Aaron Gray wrote:
 
  I am trying to work out how to use GHC.Ptr, Foreign.Storable,
  Data.Storable.Endian, and
  am looking for good examples of usage.
 
  What do you intend to do with them?
 
 
  An (ABC) ActionScript Byte Code backend for Haskell.
  Basically I need to write little-endian binary to a file, and was
 wondering
  the best way to do this; I need various types including a 24bit type.
 

 Ah, I would recommend the 'binary' package on hackage, specifically
 the module Data.Binary.Builder. Another recently popular alternative
 is the 'blaze-builder' package.


It does say that it is designed to work with bigendian data, but there are
some little-endian primatives in Data.Binary.Get/Put


 Although the 24-bit access might be difficult - how are they aligned?


They are non aligned, they are actually used as jump offsets in the byte
code.


 I guess with either of these you'd have to peek a Word8 and then a
 Word16 and then munge them together, depending.


Three put/getWord8's would probably be neater.


 http://hackage.haskell.org/package/binary
 http://hackage.haskell.org/package/blaze-builder


Blaze looks a bit more specialized.

Many thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Happy Parser problem

2010-12-31 Thread Aaron Gray
I am trying to get a grammar where keywords are also valid identifiers.

Been messing round with the following Happy grammar :-

%token
  'let'   { TokenIdent let }
  'in'{ TokenIdent in }
  ident   { TokenIdent $$ }
  int { TokenInt $$ }
  '=' { TokenEq }
  '+' { TokenPlus }
  '-' { TokenMinus }
  '*' { TokenTimes }
  '/' { TokenDiv }
  '(' { TokenOB }
  ')' { TokenCB }

%%

Exp   : 'let' Var '=' Exp 'in' Exp  { Let $2 $4 $6 }
  | Exp1{ Exp1 $1 }

Exp1  : Exp1 '+' Term   { Plus $1 $3 }
  | Exp1 '-' Term   { Minus $1 $3 }
  | Term{ Term $1 }

Term  : Term '*' Factor { Times $1 $3 }
  | Term '/' Factor { Div $1 $3 }
  | Factor  { Factor $1 }

Factor :: { Factor }
  : int { Int $1 }
  | ident   { Var $1 }
  | '(' Exp ')' { Brack $2 }

Var :: { Factor }
  : ident   { Var $1 }
  | 'let'   { Var let }

Here 'Var' should be able to represent a 'let' identifier, as well as a
keyword. Happy accepts the grammar but it does not parser the expected 'let
let = x in let'.

I have attached the full Happy grammar.

I don't think this is an LR thing, but could be wrong.

Many thanks in advance,

Aaron


exprtree.y
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Happy Parser problem

2010-12-31 Thread Aaron Gray
On 31 December 2010 13:21, Aaron Gray aaronngray.li...@gmail.com wrote:

 I am trying to get a grammar where keywords are also valid identifiers.


Sorry working now !

Aaron


 Been messing round with the following Happy grammar :-

 %token
   'let'   { TokenIdent let }
   'in'{ TokenIdent in }
   ident   { TokenIdent $$ }
   int { TokenInt $$ }
   '=' { TokenEq }
   '+' { TokenPlus }
   '-' { TokenMinus }
   '*' { TokenTimes }
  '/' { TokenDiv }
   '(' { TokenOB }
   ')' { TokenCB }

 %%

 Exp   : 'let' Var '=' Exp 'in' Exp  { Let $2 $4 $6 }
   | Exp1{ Exp1 $1 }

 Exp1  : Exp1 '+' Term   { Plus $1 $3 }
   | Exp1 '-' Term   { Minus $1 $3 }
   | Term{ Term $1 }

 Term  : Term '*' Factor { Times $1 $3 }
   | Term '/' Factor { Div $1 $3 }
   | Factor  { Factor $1 }

 Factor :: { Factor }
   : int { Int $1 }
   | ident   { Var $1 }
   | '(' Exp ')' { Brack $2 }

 Var :: { Factor }
   : ident   { Var $1 }
   | 'let'   { Var let }

 Here 'Var' should be able to represent a 'let' identifier, as well as a
 keyword. Happy accepts the grammar but it does not parser the expected 'let
 let = x in let'.

 I have attached the full Happy grammar.

 I don't think this is an LR thing, but could be wrong.

 Many thanks in advance,

 Aaron



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


[Haskell-cafe] getting last char of String

2010-12-31 Thread Aaron Gray
Is there an easy Haskell function that gets the last Char of a [Char] or
String ?

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] getting last char of String

2010-12-31 Thread Aaron Gray
On 31 December 2010 20:44, Matthew Steele mdste...@alum.mit.edu wrote:

 Sounds like you're looking for `last', which is in the Prelude.


Yep, feeling dumb I did not try it !

Thanks,

Aaron



 http://www.haskell.org/ghc/docs/6.12.2/html/libraries/base-4.2.0.1/Prelude.html#v%3Alast

 Cheers,
 -Matt


 On Dec 31, 2010, at 3:39 PM, Aaron Gray wrote:

  Is there an easy Haskell function that gets the last Char of a [Char] or
 String ?

 Many thanks in advance,

 Aaron

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



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


[Haskell-cafe] Could someone give me a small code review

2010-12-31 Thread Aaron Gray
I have attached a tiny parser and lexer.

This is really key to getting the lexing correct.

The only thing I could not get neatly was to disallow hyphens at the end of
identifiers, so have left it off until a good solution arrives.

I plan to move over to monads next.

Any comments welcome,

Aaron


exprtree.y
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Could someone give me a small code review

2010-12-31 Thread Aaron Gray
On 31 December 2010 21:26, Aaron Gray aaronngray.li...@gmail.com wrote:

 I have attached a tiny parser and lexer.

 This is really key to getting the lexing correct.

 The only thing I could not get neatly was to disallow hyphens at the end of
 identifiers, so have left it off until a good solution arrives.

 I plan to move over to monads next.

 Any comments welcome,


Oh forgot parenthesis, brackets and braces, theres a new attachment for
them.

Then there's comments to do...

Aaron


exprtree.y
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] record types and unique names

2010-12-30 Thread Aaron Gray
Given a Haskell record type :-

data Test
= Test {
name :: String,
value :: Int
}

test = Test {
name = test,
value = 1
}

main :: IO ()
main = do
putStrLn (name test)

Are name and value in the global name space, as the following gives an
error Multiple declarations of `name' :-

name :: String - String
name s = s

Is there any way round this ?

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] record types and unique names

2010-12-30 Thread Aaron Gray
On 30 December 2010 17:23, Markus Läll markus.l...@gmail.com wrote:

 Yes, they are in the global scope, and from what I gather: they are just
 regular functions, created by special syntax.

 There are a few obvious solutions (some of which you might have thought
 yourself :-):
  - rename the accessor or the other function, or
  - put the data declaration or the other function in another module and
 import qualified, or
  - write a typeclass with a 'name' function and fit the non-accessor
 function 'name' somehow into that...

 I think the best approach is the modular one, but this really depends on
 what you are doing.


Okay looks like name mangling with the datatypes name is in order then.
Something like :-

data Test
= Test {
testName :: String,
testValue :: Int
}

Thanks,

Aaron

--
 Markus Läll

 On Thu, Dec 30, 2010 at 7:01 PM, Aaron Gray aaronngray.li...@gmail.comwrote:

 Given a Haskell record type :-

 data Test
 = Test {
 name :: String,
 value :: Int
 }

 test = Test {
 name = test,
 value = 1
 }

 main :: IO ()
 main = do
 putStrLn (name test)

 Are name and value in the global name space, as the following gives an
 error Multiple declarations of `name' :-

 name :: String - String
 name s = s

 Is there any way round this ?

 Many thanks in advance,

 Aaron


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



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


Re: [Haskell-cafe] record types and unique names

2010-12-30 Thread Aaron Gray
On 30 December 2010 17:29, aditya siram aditya.si...@gmail.com wrote:

 I don't think record field disambiguation what you're after. My apologies.
 -deech


Interesting never the less.

Thanks,

Aaron


  On Thu, Dec 30, 2010 at 11:20 AM, aditya siram aditya.si...@gmail.com
 wrote:
  Take a look at the record field disambiguation [1] extension to GHC.
  It sounds like what you're looking for.
  -deech
  [1]
 http://www.haskell.org/ghc/docs/6.12.2/html/users_guide/syntax-extns.html#disambiguate-fields
 
  On Thu, Dec 30, 2010 at 11:01 AM, Aaron Gray aaronngray.li...@gmail.com
 wrote:
  Given a Haskell record type :-
  data Test
  = Test {
  name :: String,
  value :: Int
  }
  test = Test {
  name = test,
  value = 1
  }
  main :: IO ()
  main = do
  putStrLn (name test)
  Are name and value in the global name space, as the following gives
 an
  error Multiple declarations of `name' :-
  name :: String - String
  name s = s
  Is there any way round this ?
  Many thanks in advance,
  Aaron
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 
 

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


[Haskell-cafe] What are these comments for {-# SCC Mangler #-}

2010-12-29 Thread Aaron Gray
What are these comments for in Happy ?

{-# SCC Mangler #-}

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] instance for (Show ([(String, Int)] - Int))

2010-12-27 Thread Aaron Gray
On 24 December 2010 23:58, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Saturday 25 December 2010 00:32:38, Aaron Gray wrote:
  Okay great, works this end too, but what does the 'flip' do ???

 It flips the order of arguments to calc. You could also write

 main = getContents = print . (`calc` []) . lexer

 Generally,

 flip f = \x y - f y x

 or

 flip f x = \y - f y x

 flip f x y = f y x


Thanks Daniel,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] instance for (Show ([(String, Int)] - Int))

2010-12-27 Thread Aaron Gray
On 24 December 2010 23:58, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Saturday 25 December 2010 00:32:38, Aaron Gray wrote:
  Okay great, works this end too, but what does the 'flip' do ???

 It flips the order of arguments to calc. You could also write

 main = getContents = print . (`calc` []) . lexer

 Generally,

 flip f = \x y - f y x

 or

 flip f x = \y - f y x

 flip f x y = f y x


Or :-

calcExpr :: [Token] - Int
calcExpr tokens = calc tokens []

process = print . calcExpr . lexer

makes things clearer.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] ANNOUNCE: storable-endian

2010-12-26 Thread Aaron Gray
Hi Eugene,

I have been looking to do a ActionScript backend, it needs 24bit values.
Would it be possible to add some 24bit peeks and pokes, please.

Aaron

On 26 December 2010 11:13, Eugene Kirpichov ekirpic...@gmail.com wrote:

 So I got around to it.
 storable-endian 0.2.3 released, see code:
 https://github.com/jkff/storable-endian/blob/master/Data/Storable/Endian.hs
 There's some boilerplate there, but I think it's tractable.

 2010/12/25 Eugene Kirpichov ekirpic...@gmail.com:
  Thanks! Now I'll use it in storable-endian as soon as I get around to it
 :)
 
  2010/12/25 Antoine Latter aslat...@gmail.com:
  On Sat, Dec 25, 2010 at 1:31 AM, Eugene Kirpichov ekirpic...@gmail.com
 wrote:
  Great!
  Antoine, would you perhaps then update the cabal description of the
  package to include the word endianness in it? I Ctrl+F-ed endian
  through hackage before writing storable-endian and did not find your
  package.
 
 
  It is done! Although I spelled it wrong on my first try.
 
  Take care,
  Antoine
 
  2010/12/25 Antoine Latter aslat...@gmail.com:
  On Fri, Dec 24, 2010 at 8:08 AM, Henk-Jan van Tuyl hjgt...@chello.nl
 wrote:
 
  You could use ADNS.Endian.endian from package hsdns in your Setup.hs
 to
  define endianness at compile time.
 
  Regards,
  Henk-Jan van Tuyl
 
 
  It looks like I've reimplemented the same thing in its own package:
  http://hackage.haskell.org/package/byteorder
 
  With pretty much the same technique.
 
  Take care,
  Antoine
 
 
 
 
  --
  Eugene Kirpichov
  Senior Software Engineer,
  Grid Dynamics http://www.griddynamics.com/
 
 
 
 
 
  --
  Eugene Kirpichov
  Senior Software Engineer,
  Grid Dynamics http://www.griddynamics.com/
 



 --
 Eugene Kirpichov
 Senior Software Engineer,
 Grid Dynamics http://www.griddynamics.com/

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

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


[Haskell-cafe] instance for (Show ([(String, Int)] - Int))

2010-12-24 Thread Aaron Gray
How do I code an 'instance' declaration for '(Show ([(String, Int)] -
Int))'.

I am new to instance declarations and am following the Happy examples :-

http://www.haskell.org/happy/doc/html/sec-using.html#sec-other-datatypes

The compiler is requesting an instance declaration for Show :-

  expr-eval.hs:334:23:
  No instance for (Show ([(String, Int)] - Int))
arising from a use of `print' at expr-eval.hs:334:23-27
  Possible fix:
add an instance declaration for (Show ([(String, Int)] - Int))
  In the first argument of `(.)', namely `print'
  In the second argument of `(=)', namely `print . calc . lexer'
  In the expression: getContents = print . calc . lexer

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] instance for (Show ([(String, Int)] - Int))

2010-12-24 Thread Aaron Gray
On 24 December 2010 18:24, Henning Thielemann lemm...@henning-thielemann.de
 wrote:


 On Fri, 24 Dec 2010, Aaron Gray wrote:

  The compiler is requesting an instance declaration for Show :-

   expr-eval.hs:334:23:
   No instance for (Show ([(String, Int)] - Int))
 arising from a use of `print' at expr-eval.hs:334:23-27
   Possible fix:
 add an instance declaration for (Show ([(String, Int)] - Int))
   In the first argument of `(.)', namely `print'
   In the second argument of `(=)', namely `print . calc . lexer'
   In the expression: getContents = print . calc . lexer


 ... maybe 'calc' needs a further argument?


I have attached what I have typed in so far.

Aaron


expr-eval.y
Description: Binary data


expr-tree.y
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] instance for (Show ([(String, Int)] - Int))

2010-12-24 Thread Aaron Gray
On 24 December 2010 22:07, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Friday 24 December 2010 22:47:55, Aaron Gray wrote:
  On 24 December 2010 18:24, Henning Thielemann
  lemm...@henning-thielemann.de
 
   wrote:
  
  
   On Fri, 24 Dec 2010, Aaron Gray wrote:
  
The compiler is requesting an instance declaration for Show :-
  
 expr-eval.hs:334:23:
 No instance for (Show ([(String, Int)] - Int))
   arising from a use of `print' at expr-eval.hs:334:23-27
 Possible fix:
   add an instance declaration for (Show ([(String, Int)] -
   Int)) In the first argument of `(.)', namely `print'
 In the second argument of `(=)', namely `print . calc .
   lexer' In the expression: getContents = print . calc . lexer
  
   ... maybe 'calc' needs a further argument?
 
  I have attached what I have typed in so far.

 Well,

 *ExprEval :t calc
 calc :: [Token] - [(String, Int)] - Int

 calc needs an environment (a dictionary of let-bound names), which you have
 to provide.

 main = print . flip calc [] . lexer

 works fine.


Okay great, works this end too, but what does the 'flip' do ???

Now to get it to work as a REPL and to read from file :)

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Windows Haskell Platform download link is broken

2010-12-22 Thread Aaron Gray
Windows Haskell Platform download link goes nowhere :-

http://hackage.haskell.org/platform/windows.html

The Download Haskell for Windows is broken :-


http://lambda.galois.com/hp-tmp/2010.2.0.0/HaskellPlatform-2010.2.0.0-setup.exe

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
Missing Parsec library :-

scheme.o(.text+0x4fa):fake: undefined reference to
`parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany1_closure'
scheme.o(.text+0x501):fake: undefined reference to
`parseczm2zi1zi0zi0_TextziPaserCombinatorsziParsecziChar_space_closure'
scheme.o(.text+0x5c2):fake: undefined reference to
`parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziChar_oneOf_closure'
scheme.o(.text+0x63a):fake: undefined reference to
`mtlzm1zi1zi0zi0_ControlziMonadziTrans_zdf1_closure'

GHC from :-

http://www.haskell.org/ghc/dist/stable/dist/


ghc-7.0.1.20101221-i386-windows.exehttp://www.haskell.org/ghc/dist/stable/dist/ghc-7.0.1.20101221-i386-windows.exe

and earlier.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Latest Haskell Platform for Windows

2010-12-22 Thread Aaron Gray
Could someone please point me at a copy of the latest Haskell platform or a
working GHC please.

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Latest Haskell Platform for Windows

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:41, Don Stewart d...@galois.com wrote:

 aaronngray.lists:
 Could someone please point me at a copy of the latest Haskell platform
 or
 a working GHC please.
 Many thanks in advance,

 The links on haskell.org/platform should work (there was a domain
 change, so you'll no longer see lambda.galois.com links).


Okay, thanks. I obviously came along at the wrong time :)

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:27, Antoine Latter aslat...@gmail.com wrote:

 What commands did you enter to produce this error?


ghc scheme.hs

I am still getting this on the 2010 2.0.0 release.

Aaron



 Ahanks,
 Antoine

 On Wed, Dec 22, 2010 at 9:54 AM, Aaron Gray aaronngray.li...@gmail.com
 wrote:
  Missing Parsec library :-
  scheme.o(.text+0x4fa):fake: undefined reference to
 
 `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany1_closure'
  scheme.o(.text+0x501):fake: undefined reference to
  `parseczm2zi1zi0zi0_TextziPaserCombinatorsziParsecziChar_space_closure'
  scheme.o(.text+0x5c2):fake: undefined reference to
  `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziChar_oneOf_closure'
  scheme.o(.text+0x63a):fake: undefined reference to
  `mtlzm1zi1zi0zi0_ControlziMonadziTrans_zdf1_closure'
  GHC from :-
  http://www.haskell.org/ghc/dist/stable/dist/
  ghc-7.0.1.20101221-i386-windows.exe
  and earlier.
  Aaron
 
  ___
  Haskell-Cafe mailing list
  Haskell-Cafe@haskell.org
  http://www.haskell.org/mailman/listinfo/haskell-cafe
 
 

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


Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:47, Antoine Latter aslat...@gmail.com wrote:

 ghc doesn't, by default, go searching for packages to link in to the
 resulatant executable..

 If you try 'ghc --make scheme.hs' your example will work better.


Are great, thanks a lot.


 You can also specify what to link manually, but --make works pretty
 well most of the time.

 In ghc version 7 '--make' is the default, but until that's more widely
 distributed you'll want to get used to using the switch.


Yes it was linking before I upgraded GHC, hence my confusion :)

Many thanks Antoine,

Aaron



 Take care,
 Antoine

 On Wed, Dec 22, 2010 at 10:36 AM, Aaron Gray aaronngray.li...@gmail.com
 wrote:
  On 22 December 2010 16:27, Antoine Latter aslat...@gmail.com wrote:
 
  What commands did you enter to produce this error?
 
 
  ghc scheme.hs
  Aaron
 
 
  Ahanks,
  Antoine
 
  On Wed, Dec 22, 2010 at 9:54 AM, Aaron Gray aaronngray.li...@gmail.com
 
  wrote:
   Missing Parsec library :-
   scheme.o(.text+0x4fa):fake: undefined reference to
  
  
 `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany1_closure'
   scheme.o(.text+0x501):fake: undefined reference to
  
 `parseczm2zi1zi0zi0_TextziPaserCombinatorsziParsecziChar_space_closure'
   scheme.o(.text+0x5c2):fake: undefined reference to
  
 `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziChar_oneOf_closure'
   scheme.o(.text+0x63a):fake: undefined reference to
   `mtlzm1zi1zi0zi0_ControlziMonadziTrans_zdf1_closure'
   GHC from :-
   http://www.haskell.org/ghc/dist/stable/dist/
   ghc-7.0.1.20101221-i386-windows.exe
   and earlier.
   Aaron
  
   ___
   Haskell-Cafe mailing list
   Haskell-Cafe@haskell.org
   http://www.haskell.org/mailman/listinfo/haskell-cafe
  
  
 
 

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


Re: [Haskell-cafe] Missing Parsec library in latest stable GHC

2010-12-22 Thread Aaron Gray
On 22 December 2010 16:51, Daniel Fischer
daniel.is.fisc...@googlemail.comwrote:

 On Wednesday 22 December 2010 16:54:04, Aaron Gray wrote:
  Missing Parsec library :-
 
  scheme.o(.text+0x4fa):fake: undefined reference to
  `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziCombinator_skipMany
 1_closure' scheme.o(.text+0x501):fake: undefined reference to
  `parseczm2zi1zi0zi0_TextziPaserCombinatorsziParsecziChar_space_closure'
  scheme.o(.text+0x5c2):fake: undefined reference to
  `parseczm2zi1zi0zi0_TextziParserCombinatorsziParsecziChar_oneOf_closure'
  scheme.o(.text+0x63a):fake: undefined reference to
  `mtlzm1zi1zi0zi0_ControlziMonadziTrans_zdf1_closure'
 
  GHC from :-
 
  http://www.haskell.org/ghc/dist/stable/dist/
 
 
  ghc-7.0.1.20101221-i386-windows.exehttp://www.haskell.org/ghc/dist/stab
 le/dist/ghc-7.0.1.20101221-i386-windows.exe
 
  and earlier.
 
  Aaron

 Since 6.8 iirc, GHC no longer comes with parsec, you have to install the
 package yourself if you want to use it,

 cabal install parsec


This does not seem to be needed.

import Text.ParserCombinators.Parsec

seems fine.



 also mtl is no longer one of the libraries that come with GHC,

 cabal install mtl


What is mtl ?

Thanks,

Aaron



 HTH,
 Daniel

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


[Haskell-cafe] Problem with class Control.Monad.Error noMsg usage

2010-12-21 Thread Aaron Gray
I have been trying to build the Scheme in 24 Hours on WikiBooks :-

http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours

http://jonathan.tang.name/files/scheme_in_48/code/listing10.hs

But I am getting an error :-

scheme.hs:289:6: `noMsg' is not a (visible) method of class `Error'

scheme.hs:290:6:
 `strMsg' is not a (visible) method of class `Error'

with the following :-

instance Error LispError where
 noMsg = Default An error has occurred
 strMsg = Default

if I try importing them :-

import Control.Monad.Error (noMsg, strMsg)

I get the following :-

scheme.hs:4:29:
Module `Control.Monad.Error' does not export `noMsg'

scheme.hs:4:36:
Module `Control.Monad.Error' does not export `strMsg'

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Problem with class Control.Monad.Error noMsg usage

2010-12-21 Thread Aaron Gray
On 21 December 2010 15:40, Henning Thielemann 
schlepp...@henning-thielemann.de wrote:

 Aaron Gray schrieb:

  if I try importing them :-
 
  import Control.Monad.Error (noMsg, strMsg)

 I think it was moved to Control.Monad.Error.Class.


Great, importing Control.Monad.Error.Class does the trick.

Thanks,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] REPL loop

2010-12-20 Thread Aaron Gray
Is it possible to implement a REPL (Read-eval-print loop) in Haskell ?

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Musings on type systems

2010-11-19 Thread Aaron Gray
On 19 November 2010 22:14, Albert Y. C. Lai tre...@vex.net wrote:

 On 10-11-19 04:39 PM, Matthew Steele wrote:

 TAPL is also a great book for getting up to speed on type theory:

 http://www.cis.upenn.edu/~bcpierce/tapl/

 I am no type theorist, and I nonetheless found it very approachable.


 TAPL is surprisingly easy-going. It is long (many pages and many chapters,
 each chapter short), but it is the good kind of long: long but gradual ramp
 to get you to the hard stuff. Its first chapter explains convincingly why
 you should care about types to begin with (summary: a lightweight formal
 method).

 But it is not entirely for Haskell. It covers subtyping, and it doesn't
 cover type classes.

 It is also too bulky to be mobile (because it's long).


IIRC It Does not deal Hindley-Milner type system at all. i.e. it does not
cover ML's type system.

Its successor ATTAPL :-

http://www.cis.upenn.edu/~bcpierce/attapl/index.html

Handles an ML like type systems using constraints.

AFAICT This area area of type theory's history is not covered properly in
any of the sources I have came across.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] borked windows environment, want to start over

2010-11-17 Thread Aaron Gray
On 17 November 2010 15:47, Henk-Jan van Tuyl hjgt...@chello.nl wrote:

 On Wed, 17 Nov 2010 01:39:40 +0100, Michael Litchard mich...@schmong.org
 wrote:

  I think I may have borked things good using cygwin. I want to remove
 it and do a clean install of haskell platform w/out cygwin. What do I
 need to do to make sure all configuration files have been removed?


 There are not many Cygwin experts here, I think, but it seems the answer
 can be found at:
  http://www.cygwin.com/faq/faq-nochunks.html#faq.setup.uninstall-all


AFAICT Just don't use Cygwin. Install Windows Haskell from the Haskell.org
web site download. Then run from Windows command line. You may have to put
the haskell bin directory on the Windows PATH. Although I think it does this
itself on instillation.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Gödel's System T

2010-11-11 Thread Aaron Gray
On 11 November 2010 11:43, Petr Pudlak d...@pudlak.name wrote:

 Thanks Dan, the book is really interesting, all parts of it. It looks like
 I'll read the whole book.


Watch out for the decidability issue though :-

http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.6.6483

Aaron



  Best regards,
  Petr


 On Wed, Nov 10, 2010 at 05:21:16PM -0500, Dan Doel wrote:

 On Wednesday 10 November 2010 1:42:00 pm Petr Pudlak wrote:

 I was reading the paper Total Functional Programming [1]. I
 encountered an interesting note on p. 759 that primitive recursion in a
 higher-order language allows defining much larger set of function than
 classical primitive recursion (which, for example, cannot define
 Ackermann's function). And that this is studied in in Gödel's System T.
 It also states that this larger set of primitive functions includes all
 functions whose totality can be proved in first order logic.

 I was searching the Internet but I couldn't find a resource (a paper, a
 book) that would explain this in detail, give proofs etc. I'd be happy
 if someone could give me some directions.


 Girard's book, Proofs and Types, has some stuff on System T. A translation
 is
 freely available:

  http://www.paultaylor.eu/stable/Proofs+Types.html

 Skimming, it looks like he gives an argument that T can represent all
 functions that are provably total in Peano arithmetic.

 The rest of the book is also excellent.

 -- Dan
 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe


 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (GNU/Linux)

 iQEcBAEBAgAGBQJM29b+AAoJEC5dcKNjBzhn7CAH/1DYIpZcWenZs4D+cPW2V9+F
 oET+abW2MgdRPPRquDT4qd/nLnI4XhTiiJEZq8mwfAY4OXBUjHnXLKTlKWyHkgCH
 zIRPIXWj0PSHNX+2yAB7muhWmOJv/BfrS9DOKsUDF3Qirtl9kc9x9SkWkVuRe2Yf
 JSAp+biYQkTSQg2MntHuprqTn783lfsLyKOvtNkybk3Kt+Ft7dzPmQgtgXCd5fPm
 eKI1D3b5H5NOH4cwYYUKejpc+8mptTdJVy6Hw8USI4e+hnoe62CZ/2bBf/lOyoCB
 UwNJ09sT5yepyA2DimvI3yZX33OB/K24xfPhsnvHaWAHyz3AkdeMG21eertnmtM=
 =zOw9
 -END PGP SIGNATURE-

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


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


[Haskell-cafe] ActionScript Byte Code backend ?

2010-11-09 Thread Aaron Gray
Is there a Flash ActionScript Byte Code generating backend for Haskell ?

I know there was an older SWF 3 backend :-

http://www.n-heptane.com/nhlab/repos/haskell-swf/

But is there anything more up to date ?

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] [ANNAUNCE] ghcjs-0.1.0 Haskell to Javascript compiler

2010-10-29 Thread Aaron Gray
On 27 October 2010 13:30, Martijn Schrage mart...@oblomov.com wrote:

 On 21-10-10 01:01, Victor Nazarov wrote:


 This example creates a text field that turns red if it contains any
 non-digit characters. It is on-line at
 http://tryout.oblomov.com/ghcjs/ghcjs.html  (Note: I only tested it on
 Firefox on a Mac)

 All used files are in a zip file at
 http://tryout.oblomov.com/ghcjs/ghcjs.zip (validate is in Test.hs, the JS
 monad in JS.hs, and the JavaScript for execHaskell in util.js)


What browser are you using, IE8, IE9, FF and Chrome on Windows throw up
errors, both locally and to your above code.

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Windows binary for latest darcs head

2010-10-12 Thread Aaron Gray
Does anyone have a Windows binary for the latest GHC darcs head or at least
October 8th they could send me.

Many thanks in advance,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Regular Expression to Determinate Finite Automata translator

2010-07-22 Thread Aaron Gray
Hi,

I am a Haskell newbie. I have coded a Regular Expression to Determinate
Finite Automata translator. Algorithm from the Dragon Book.

Would someone eyeball the code and give me suggestions please.

I have not done anything on character classes yet though. And the parsing is
a bit of a hack.

What I am not sure about is having to have multiple versions of similar
datatype, each with variations in order to enumerate and generate followPos
set.

Is there a better way of implementing this ?

Many thanks in advance,

Aaron


RE2DFA.hs
Description: Binary data
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Typing Haskell in Haskell

2010-05-01 Thread Aaron Gray
Hi,

I am relatively new to Haskell. I am attempting to get Typing Haskell in
Haskell to work on HUGS or GHC.

   http://web.cecs.pdx.edu/~mpj/thih/

I am getting an error on loading SourcePrelude :-

   Hugs :l SourcePrelude
   ERROR .\PPrint.hs - Can't find imported module Pretty

And I cannot find a Pretty module, the module and Language.Haskell.Pretty
does not seem to be what is required.

Any help welcome,

Aaron
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe