[Haskell-cafe] Newbie question about using WinGHCi

2010-07-01 Thread Christopher Tauss
Hello - I just a day or so ago downloaded Hakell and am playing around with it, and I came upon this problem with WinGHCi: I am able to enter a multi-line do statement that works if I use brackets and semi-colon like so: Prelude :{ Prelude| let main2 = do { Prelude| putStrLn Please enter your

Re: [Haskell-cafe] Newbie question about using WinGHCi

2010-07-01 Thread Ivan Miljenovic
On 1 July 2010 16:04, Christopher Tauss ctau...@gmail.com wrote: Hello - I just a day or so ago downloaded Hakell and am playing around with it, and I came upon this problem with WinGHCi: I am able to enter a multi-line do statement that works if I use brackets and semi-colon like so:

[Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

2010-07-01 Thread Vincent Hanquez
Hi Haskell-cafe, I'ld like to announce the existence of hs-cryptohash [1] which provides most common digests (sha1, sha2 family, md[245], ripemd160) in a incremental and one-pass api. It's also much faster than pure haskell implementation i've played with, since the underlaying algorithms are

[Haskell-cafe] chart broken under 6.12 according to criterion

2010-07-01 Thread Tom Doris
According to the criterion.cabal file shipped with the latest (0.5.0.1) version of criterion, the Chart package is broken under GHC 6.12: flag Chart ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

[Haskell-cafe] Re: chart broken under 6.12 according to criterion

2010-07-01 Thread Tom Doris
According to the criterion.cabal file shipped with the latest (0.5.0.1) version of criterion, the Chart package is broken under GHC 6.12: flag Chart description: enable use of the Chart package -- Broken under GHC 6.12 so far Does anyone know the status of this problem? It's been a little

Re: [Haskell-cafe] Re: chart broken under 6.12 according to criterion

2010-07-01 Thread Neil Brown
On 01/07/10 10:19, Tom Doris wrote: According to the criterion.cabal file shipped with the latest (0.5.0.1) version of criterion, the Chart package is broken under GHC 6.12: flag Chart description: enable use of the Chart package -- Broken under GHC 6.12 so far Does anyone know the

[Haskell-cafe] functional dependencies question

2010-07-01 Thread Patrick Browne
Hi, My understanding of functional dependencies is that they can be used to ensure that one type depends on another type. For example, the type of location depends could on the type of the object at that location. Consider two models 1) The location of an aircraft landing should have location of

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Neil Brown
On 01/07/10 12:37, Patrick Browne wrote: Why do some cases such as 1) fail to run even if they are the only instantiation. -- 1) Compiles but does not run instance LocatedAt Int String where spatialLocation(1)=home That instance is fine. I presume the problem is that you are trying

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Patrick Browne
Neil, Does the following sum up the situation? The class Num has subclasses containing various numeric types and the literal 1 is a value for one or more of those types. Hence the Haskell compiler says the instance 1) is OK. But at run time, without the quantified (1:Int), the 1 could of more than

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Ketil Malde
Patrick Browne patrick.bro...@dit.ie writes: Why do some cases such as 1) fail to run even if they are the only instantiation. I think this is because literal numbers are polymorphic, i.e. a '1' in your source code is shorthand for 'fromIntegral 1', which is a type of Num a = a. Thus,

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Miguel Mitrofanov
The class Num has subclasses containing various numeric types and the literal 1 is a value for one or more of those types. Well, the problem is not with subclasses, but with types. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] functional dependencies question

2010-07-01 Thread Neil Brown
On 01/07/10 13:11, Patrick Browne wrote: Neil, Does the following sum up the situation? The class Num has subclasses containing various numeric types and the literal 1 is a value for one or more of those types. Hence the Haskell compiler says the instance 1) is OK. But at run time, without the

[Haskell-cafe] Re: dirs in Emacs/Vim in Cabal

2010-07-01 Thread Nils Anders Danielsson
On 2010-06-30 18:38, Chris BROWN wrote: My question is: Is it possible to allow the emacs/vim scripts that I have know where this directory is automatically? Maybe you could adapt the approach taken by Agda. Agda's Emacs mode is installed using Cabal plus a small script: 1) The Emacs Lisp

Re: [Haskell-cafe] State of the Hackage: Q1, Q2 2010

2010-07-01 Thread Don Stewart
I think we need to standardise the presentation of this data, and provide a lib to access it. I'll think some more about it. Should be possible to automate it all now (that's mostly done), publish in a known location, and provide an API for queries. inforichland: If anyone wants to see the

Re: [Haskell-cafe] State of the Hackage: Q1, Q2 2010

2010-07-01 Thread Tim Wawrzynczak
That sounds like an excellent idea! If you would like some help, let me know and I would be glad to :) Cheers, - Tim On Thu, Jul 1, 2010 at 11:50 AM, Don Stewart d...@galois.com wrote: I think we need to standardise the presentation of this data, and provide a lib to access it. I'll think

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-01 Thread Zura_
It depends on the type of a position. If it is a one-shot/contract job then you are looking for the concrete skillset/expertise, i.e. Haskell. For relatively longterm or permanent positions I think it is better to give a priority to smart and getting things done type of persons rather than

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-01 Thread Don Stewart
That's not really true. We train people at Galois in Haskell, on the job. Often they have prior FP experience, but not always. aditya.siram: And learning (fun) should be an important aspect of the position. Whatever FP you're coming from, I don't think you can pick up Haskell on the job.

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-01 Thread aditya siram
Right, but I assume you have local experts who are willing to teach on site. In most companies I've worked for there is minimal training. Haskell really needs someone who can patiently walk alongside. I'm picturing a non-Haskell developer getting thrown into the deep end. Now that I think about

RE: [Haskell-cafe] checking types with type families

2010-07-01 Thread Simon Peyton-Jones
| Here's a concrete case I recently ran into: | | type family SomeOtherTypeFamily a | class SomeClass a where type SomeType a | instance a ~ SomeOtherTypeFamily b = SomeClass a where |type SomeType a = (b,Int) |-- (error) Not in scope: type variable `b' | | The same thing

RE: [Haskell-cafe] checking types with type families

2010-07-01 Thread Simon Peyton-Jones
Claus | I'm interested in situations where you think fundeps work | and type families don't. Reason: no one knows how to make | fundeps work cleanly with local type constraints (such as GADTs). | | If you think you have such as case, do send me a test case. | | Do you have a wiki

RE: [Haskell-cafe] Inferring the most general type

2010-07-01 Thread Simon Peyton-Jones
I don't know an algorithm that can always infer the most general types in situations like this. In your example, if you give a signature for the simple function (f :: Y Maybe - Int), and use RelaxedPolyRec, then GHC will happily infer the type you want for g. For RelaxedPolyRec to work its

RE: [Haskell-cafe] checking types with type families

2010-07-01 Thread Simon Peyton-Jones
| Well, from looking at the documentation, it looks like I could maybe | use a type family if I could write: | | class (DerivedOf a ~ derived) = Typecheck a derived where | ... That's the right idiom yes. But see my message of a few minutes ago... It's neater still to remove the

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-07-01 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 7/1/10 13:41 , aditya siram wrote: I'm picturing a non-Haskell developer getting thrown into the deep end. Now that I think about it I think that's part of why companies choose Java/C# etc. - they can just let Google train their people. ...and

[Haskell-cafe] Associated types

2010-07-01 Thread Andrew Coppin
Consider the following: class Path p where ... class Path p = CompletePath p where ... class Path p = IncompletePath p where type CompletedPath p :: * Obviously, the idea is that CompletedPath Foo (where Foo is an IncompletePath) should yield some type which is a CompletePath. However,

Re: [Haskell-cafe] Associated types

2010-07-01 Thread David Menendez
On Thu, Jul 1, 2010 at 2:09 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Consider the following:  class Path p where ...  class Path p = CompletePath p where ...  class Path p = IncompletePath p where   type CompletedPath p :: * Obviously, the idea is that CompletedPath Foo

Re: [Haskell-cafe] Associated types

2010-07-01 Thread Andrew Coppin
David Menendez wrote: Something like this should work: class (Path p, CompletePath (CompletedPath p)) = IncompletePath p where type CompletedPath p :: * Oh, you can do that? (I.e., mention the CompletedPath function before you've defined it.) Sweet...

Re: [Haskell-cafe] Associated types

2010-07-01 Thread Christopher Lane Hinson
Something like this should work: class (Path p, CompletePath (CompletedPath p)) = IncompletePath p where type CompletedPath p :: * AIUI, this isn't implemented yet. You'll have to place the constraint on each involved function. Friendly, --Lane

Re: [Haskell-cafe] Associated types

2010-07-01 Thread Christopher Lane Hinson
On Thu, 1 Jul 2010, Christopher Lane Hinson wrote: Something like this should work: class (Path p, CompletePath (CompletedPath p)) = IncompletePath p where type CompletedPath p :: * AIUI, this isn't implemented yet. You'll have to place the constraint on each involved function.

Re: [Haskell-cafe] Associated types

2010-07-01 Thread Miguel Mitrofanov
GADTs? data CompletePathEv p where CompletePathEv :: CompletePath p = CompletePathEv p class Path p = IncompletePath p where type CompletedPath p :: * completedPathEv :: CompletePathEv (CompletedPath p) Later you can pattern-match on completedPathEv and get your CompletePath

Re: [Haskell-cafe] Associated types

2010-07-01 Thread David Menendez
On Thu, Jul 1, 2010 at 2:35 PM, Christopher Lane Hinson l...@downstairspeople.org wrote: On Thu, 1 Jul 2010, Christopher Lane Hinson wrote: Something like this should work: class (Path p, CompletePath (CompletedPath p)) = IncompletePath p where   type CompletedPath p :: * AIUI, this

Re: [Haskell-cafe] checking types with type families

2010-07-01 Thread Martin Sulzmann
On Thu, Jul 1, 2010 at 7:54 PM, Simon Peyton-Jones simo...@microsoft.comwrote: | Also, what is the difference between fundeps and type families | wrt local type constraints? I had always assumed them to be | equivalent, if fully implemented. Similar to logic vs functional | programming,

Re: [Haskell-cafe] Associated types

2010-07-01 Thread Edward Kmett
On Thu, Jul 1, 2010 at 2:26 PM, Christopher Lane Hinson l...@downstairspeople.org wrote: class (Path p, CompletePath (CompletedPath p)) = IncompletePath p where type CompletedPath p :: * AIUI, this isn't implemented yet. You'll have to place the constraint on each involved function.

[Haskell-cafe] Finding zipper for custom tree

2010-07-01 Thread Sergey Mironov
Hello list! I am trying to understand zipper concept using papers like [1] and [2]. Though main idea looks clear, I still have a problem in applying it for custom data types. Please help me with deriving Zipper-type from data DTree a = P | D [(a, DTree)] Looking in [1] ('Zippers via

[Haskell-cafe] Getting started

2010-07-01 Thread Mrwibbly
I'm having real trouble starting this project. Basically I have to create a record store that store information about artists and albums and also the number of sales that they have had. It also needs to generate a list of the top 5 sellers. So far I have: recordSale :: Sales - String - String -

RE: [Haskell-cafe] checking types with type families

2010-07-01 Thread Eduard Sergeev
Simon Peyton-Jones wrote: I'm interested in situations where you think fundeps work and type families don't. Reason: no one knows how to make fundeps work cleanly with local type constraints (such as GADTs). If you think you have such as case, do send me a test case. As an example, is

[Haskell-cafe] ghc api printing of types

2010-07-01 Thread Phyx
I was wondering how given a Type I can get a pretty printed type out of it. I'm currently using showSDocUnqual . pprType . snd . tidyOpenType emptyTidyEnv But this has the problem that predicates don't get printed, anyone know how GHCi does this? Thanks, Phyx

Re: [Haskell-cafe] Getting started

2010-07-01 Thread aditya siram
Firstly, do you mean recordSale sales anArtist anAlbum ? First off consider a datatype to model albums - something like: type Name = String type Artist = String type Sold = Int data Album = Album Name Sold And consider storing then in a hash [1] where the artist name is the key and [Album] is

Re: [Haskell-cafe] State of the Hackage: Q1, Q2 2010

2010-07-01 Thread Bas van Dijk
On Thu, Jul 1, 2010 at 6:50 PM, Don Stewart d...@galois.com wrote: I think we need to standardise the presentation of this data, and provide a lib to access it. This, together with reverse dependencies[1], would be a nice feature for the upcoming hackage-server. Regards, Bas [1]

Re: [Haskell-cafe] Getting started

2010-07-01 Thread Holger Siegel
Am 01.07.2010 um 21:56 schrieb Mrwibbly: I'm having real trouble starting this project. Basically I have to create a record store that store information about artists and albums and also the number of sales that they have had. It also needs to generate a list of the top 5 sellers. So

Re: [Haskell-cafe] Finding zipper for custom tree

2010-07-01 Thread Luke Palmer
On Thu, Jul 1, 2010 at 1:54 PM, Sergey Mironov ier...@gmail.com wrote: Hello list! I am trying to understand zipper concept using papers like [1] and [2]. Though main idea looks clear, I still have a problem in applying it for custom data types. Please help me with deriving Zipper-type from

Re: [Haskell-cafe] Type-Level Programming

2010-07-01 Thread wren ng thornton
Andrew Coppin wrote: wren ng thornton wrote: Andrew Coppin wrote: It's a bit like trying to learn Prolog from somebody who thinks that the difference between first-order and second-order logic is somehow common knowledge. (FWIW, I have absolutely no clue what that difference is.

Re: [Haskell-cafe] Type-Level Programming

2010-07-01 Thread wren ng thornton
Andrew Coppin wrote: I did wonder what the heck a type function is or why you'd want one. And then a while later I wrote some code along the lines of class Collection c where type Element c :: * empty :: c - Bool first :: c - Element c So now it's like Element is a function that

Re: [Haskell-cafe] Re: chart broken under 6.12 according to criterion

2010-07-01 Thread wren ng thornton
Neil Brown wrote: On 01/07/10 10:19, Tom Doris wrote: According to the criterion.cabal file shipped with the latest (0.5.0.1) version of criterion, the Chart package is broken under GHC 6.12: flag Chart description: enable use of the Chart package -- Broken under GHC 6.12 so far Does

Re: [Haskell-cafe] Re: chart broken under 6.12 according to criterion

2010-07-01 Thread Neil Brown
On 02/07/2010 00:03, wren ng thornton wrote: OS= OSX 10.5.8 GHC = 6.12.1 Cabal-Install = 0.8.2 Cabal = 1.8.0.2 $ cabal install criterion -fChart --reinstall Resolving dependencies... ... Configuring cairo-0.11.0... setup: gtk2hsC2hs is required but it

Re: [Haskell-cafe] chart broken under 6.12 according to criterion

2010-07-01 Thread Ivan Miljenovic
On 1 July 2010 19:16, Tom Doris tomdo...@gmail.com wrote: According to the criterion.cabal file shipped with the latest (0.5.0.1) version of criterion, the Chart package is broken under GHC 6.12: When Bryan last released Criterion, gtk2hs (and hence Chart) was unbuildable on GHC 6.12 (which was

Re: [Haskell-cafe] ANNOUNCE: hs-cryptohash 0.4

2010-07-01 Thread Ivan Miljenovic
On 1 July 2010 17:25, Vincent Hanquez t...@snarc.org wrote: The main reason for this library is the lack of incremental api exposed by current digest libraries, and filling the void about some missing digest algorithms; Also the speed comes as a nice bonus. Can you explain what you mean by

Re: [Haskell-cafe] Associated types

2010-07-01 Thread Ivan Miljenovic
On 2 July 2010 04:48, David Menendez d...@zednenem.com wrote: Maybe you're thinking of equality superclasses. In another thread, this example came up: | class (DerivedOf a ~ derived) = Typecheck a derived where which doesn't work yet, but should work in 6.14. I've asked Manuel Chakravarty

Re: [Haskell-cafe] State of the Hackage: Q1, Q2 2010

2010-07-01 Thread Matthew Gruen
On Thu, Jul 1, 2010 at 4:26 PM, Bas van Dijk v.dijk@gmail.com wrote: On Thu, Jul 1, 2010 at 6:50 PM, Don Stewart d...@galois.com wrote: I think we need to standardise the presentation of this data, and provide a lib to access it. This, together with reverse dependencies[1], would be a

Re: [Haskell-cafe] Getting started

2010-07-01 Thread Sean Perry
If you have not read it yet give http://learnyouahaskell.com a look. Towards the end he walks through some of these kind of design issues starting with types and functions working on the types. Also, try putting the types and functions in a file and then loading the file in ghci with ghci foo.hs.

[Haskell-cafe] Re: checking types with type families

2010-07-01 Thread oleg
Simon Peyton-Jones wrote: Until now, no one has know how to combine fundeps and local constraints. For example class C a b | a-b where op :: a - b instance C Int Bool where op n = n0 data T a where T1 :: T a T2 :: T Int -- Does this typecheck? f :: C a b