Re: [Haskell-cafe] Datapacker?

2012-05-09 Thread sharon kimble
On Thursday 10 May 2012 04:09:33 sharon kimble wrote:
> On Thursday 10 May 2012 04:01:56 you wrote:
> > What is datapacker? Can you summarize the sort of problem you are having?
> 
> https://github.com/jgoerzen/datapacker/wiki  datapacker is a
> tool to group files by size. It is perhaps most often used to fit a set of
> files onto the minimum number of CDs or DVDs.
> 
> I just want to check the syntax of the command before i commit it to stone
> for backing up my mp3s?
> 
> Thanks
> Sharon.
> 
> > On May 9, 2012 9:34 PM, "sharon kimble"  wrote:
> > > Is this the right place to ask questions about datapacker please? If
> > > not, can
> > > anyone tell me where is please?
> > > 
> > > Thanks
> > > Sharon.
> > > --

-- 
A taste of linux = http://www.sharons.org.uk/taste/index.html
efever = http://www.efever.blogspot.com/
efever = http://sharon04.livejournal.com/
Debian 6,0.4, Gnome 1:2.30+7, LibreOffice 3.4.6
Registered Linux user 334501 

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


Re: [Haskell-cafe] Datapacker?

2012-05-09 Thread Antoine Latter
On Wed, May 9, 2012 at 10:09 PM, sharon kimble  wrote:
> On Thursday 10 May 2012 04:01:56 you wrote:
>> What is datapacker? Can you summarize the sort of problem you are having?
>
> https://github.com/jgoerzen/datapacker/wiki  datapacker is a tool
> to group files by size. It is perhaps most often used to fit a set of files 
> onto
> the minimum number of CDs or DVDs.
>
> I just want to check the syntax of the command before i commit it to stone for
> backing up my mp3s?
>

You should probably ask the author - that link is a part of the
author's personal github page. Here is some contact information:

http://www.complete.org/JohnGoerzen

Antoine

> Thanks
> Sharon.
>>
>> On May 9, 2012 9:34 PM, "sharon kimble"  wrote:
>> > Is this the right place to ask questions about datapacker please? If not,
>> > can
>> > anyone tell me where is please?
>> >
>> > Thanks
>> > Sharon.
>> > --
>
> --
> A taste of linux = http://www.sharons.org.uk/taste/index.html
> efever = http://www.efever.blogspot.com/
> efever = http://sharon04.livejournal.com/
> Debian 6,0.4, Gnome 1:2.30+7, LibreOffice 3.4.6
> Registered Linux user 334501

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


Re: [Haskell-cafe] Datapacker?

2012-05-09 Thread Antoine Latter
What is datapacker? Can you summarize the sort of problem you are having?
On May 9, 2012 9:34 PM, "sharon kimble"  wrote:

> Is this the right place to ask questions about datapacker please? If not,
> can
> anyone tell me where is please?
>
> Thanks
> Sharon.
> --
> A taste of linux = http://www.sharons.org.uk/taste/index.html
> efever = http://www.efever.blogspot.com/
> efever = http://sharon04.livejournal.com/
> Debian 6,0.4, Gnome 1:2.30+7, LibreOffice 3.4.6
> Registered Linux user 334501
>
> ___
> 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] Datapacker?

2012-05-09 Thread sharon kimble
Is this the right place to ask questions about datapacker please? If not, can 
anyone tell me where is please?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk/taste/index.html
efever = http://www.efever.blogspot.com/
efever = http://sharon04.livejournal.com/
Debian 6,0.4, Gnome 1:2.30+7, LibreOffice 3.4.6
Registered Linux user 334501 

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


[Haskell-cafe] Haskell Weekly News: Issue 226

2012-05-09 Thread Daniel Santa Cruz
Welcome to issue 226 of the HWN, an issue covering crowd-sourced bits
of information about Haskell from around the web. This issue covers the
week of April 29 to May 5, 2012.

Quotes of the Week

   * acowley: I write the most complicated bottoms

   * Cale: OpenGL is the Rubik's Cube of graphics libraries. It's nearly
   impossible to change some things without affecting other things

Top Reddit Stories

   * HJ — Haskell-to-JavaScript compiler (WIP)
 Domain: chrisdone.com, Score: 74, Comments: 23
 On Reddit: [1] http://goo.gl/gP51N
 Original:  [2] http://goo.gl/g32rz

   * Life Without Objects
 Domain: skipoleschris.blogspot.co.uk, Score: 52, Comments: 17
 On Reddit: [3] http://goo.gl/LZmLC
 Original:  [4] http://goo.gl/NLhKH

   * New major release of the containers package
 Domain: blog.johantibell.com, Score: 52, Comments: 25
 On Reddit: [5] http://goo.gl/yjblJ
 Original:  [6] http://goo.gl/DKlmd

   * Haskell and the World: Encodings and the Common Misuse of ByteString
 Domain: a-dimit.blogspot.com, Score: 50, Comments: 27
 On Reddit: [7] http://goo.gl/WloCn
 Original:  [8] http://goo.gl/oeIIW

   * How to write hybrid CPU/GPU programs with Haskell
 Domain: parfunk.blogspot.com.au, Score: 48, Comments: 3
 On Reddit: [9] http://goo.gl/u9A9l
 Original: [10] http://goo.gl/s917R

   * phantom tainting with kind error messages
 Domain: article.gmane.org, Score: 35, Comments: 5
 On Reddit: [11] http://goo.gl/V9qRd
 Original:  [12] http://goo.gl/cx4cD

   * Annotated slides: Comparing Dynamic and Static Language Approaches to
 Web Frameworks (Rails vs Yesod)
 Domain: cs.kent.ac.uk, Score: 32, Comments: 11
 On Reddit: [13] http://goo.gl/jE2iK
 Original:  [14] http://goo.gl/2dIjQ

   * SPJ talk: Towards Haskell in the Cloud
 Domain: skillsmatter.com, Score: 30, Comments: 16
 On Reddit: [15] http://goo.gl/fVc0e
 Original:  [16] http://goo.gl/NMtPD

   * hotswap -- a simple, high level interface to plugins for hotswapping
code
 Domain: hackage.haskell.org, Score: 29, Comments: 8
 On Reddit: [17] http://goo.gl/kvhOS
 Original:  [18] http://goo.gl/VMAe0

   * Online Haskell typechecker
 Domain: haskellonline.org, Score: 29, Comments: 12
 On Reddit: [19] http://goo.gl/uV3HY
 Original:  [20] http://goo.gl/lSwhb

Top StackOverflow Questions

   * Algebraically interpreting polymorphism
 votes: 21, answers: 5
 Read on SO: [21] http://goo.gl/7krnc

   * Absolute value of negative zero - bug, or a part of the floating
 point standard?
 votes: 16, answers: 3
 Read on SO: [22] http://goo.gl/HDpRc

   * how to implement doubly linked lists
 votes: 10, answers: 1
 Read on SO: [23] http://goo.gl/hXyDM

   * GHC type inference for higher rank types - assigning to monotypes
 votes: 10, answers: 1
 Read on SO: [24] http://goo.gl/TqYtX

   * Communication between Java and Haskell
 votes: 9, answers: 3
 Read on SO: [25] http://goo.gl/zMYwx

   * Default constraint kinds are ignored
 votes: 9, answers: 2
 Read on SO: [26] http://goo.gl/AElL4

   * Scrap Your Boilerplate equivalent in Scala?
 votes: 7, answers: 1
 Read on SO: [27] http://goo.gl/Cd7k4

   * Does the chain function in underscore.js create a monad?
 votes: 7, answers: 1
 Read on SO: [28] http://goo.gl/DUYkB

   * Why do Haskell list comprehensions with multiple generators treat the
 rightmost generator as the tightest loop?
 votes: 6, answers: 3
 Read on SO: [29] http://goo.gl/BnndW

   * Haskell records, cleaner approach?
 votes: 6, answers: 1
 Read on SO: [30] http://goo.gl/MymyL

Until next time,
Daniel Santa Cruz

References

   1. http://chrisdone.com/hj/
   2.
http://www.reddit.com/r/haskell/comments/t06ej/hj_haskelltojavascript_compiler_wip/
   3. http://skipoleschris.blogspot.co.uk/2012/04/life-without-objects.html
   4. http://www.reddit.com/r/haskell/comments/t1oen/life_without_objects/
   5.
http://blog.johantibell.com/2012/05/new-major-release-of-containers-package.html
   6.
http://www.reddit.com/r/haskell/comments/t688l/new_major_release_of_the_containers_package/
   7. http://a-dimit.blogspot.com/2012/04/strings-in-haskell.html
   8.
http://www.reddit.com/r/haskell/comments/syo8h/haskell_and_the_world_encodings_and_the_common/
   9.
http://parfunk.blogspot.com.au/2012/05/how-to-write-hybrid-cpugpu-programs.html
  10.
http://www.reddit.com/r/haskell/comments/t7znh/how_to_write_hybrid_cpugpu_programs_with_haskell/
  11. http://article.gmane.org/gmane.comp.lang.haskell.cafe/98103
  12.
http://www.reddit.com/r/haskell/comments/t6dn7/phantom_tainting_with_kind_error_messages/
  13. http://www.cs.kent.ac.uk/~nccb/rails-yesod-slides.pdf
  14.
http://www.reddit.com/r/haskell/comments/t1aw8/annotated_slides_comparing_dynamic_and_static/
  15. http://skillsmatter.com/podcast/home/haskell-cloud/js-4179
  16.
http://www.reddit.com/r/haskell/comment

Re: [Haskell-cafe] Fixed point newtype confusion

2012-05-09 Thread wren ng thornton

On 5/8/12 8:24 PM, Sebastien Zany wrote:

Hmm, I don't understand how that would work.


Using one of the fundep versions:

class (Functor f) => Fixpoint f x | ... where
fix :: f x -> x
unfix :: x -> f x

We'd define instances like the following:

data List a = Nil | Cons a (List a)

data PreList a b = PNil | PCons a b
deriving Functor

instance Fixpoint (PreList a) (List a) where
-- fix :: PreList a (List a) -> List a
fix PNil = Nil
fix (PCons x xs) = Cons x xs

-- unfix :: List a -> PreList a (List a)
unfix Nil = PNil
unfix (Cons x xs) = PCons x xs

Or we could do:

newtype Fix f = Fix { unFix :: f (Fix f) }

instance Fixpoint (PreList a) (Fix (PreList a)) where
-- fix :: PreList a (Fix (PreList a)) -> Fix (PreList a)
fix = Fix

-- unfix :: Fix (PreList a) -> PreList a (Fix (PreList a))
unfix = unFix



I wish I could define something like this:

class (Functor f) =>  Fixpoint f x | x ->  f where
 fix :: x ->  Fix f

instance (Functor f) =>  Fixpoint f (forall a. f a) where
 fix = id

instance (Functor f, Fixpoint f x) =>  Fixpoint f (f x) where
 fix = Fix . fmap fix

but instances with polymorphic types aren't allowed. (Why is that?)



Well, one problem is that (forall a. f a) is not a fixed-point of f. 
That is, f (forall a. f a) is not isomorphic to (forall a. f a)



Another problem is that (forall a. f a) isn't exactly of kind *. It sort 
of is, but since it's quantifying over * you get into (im)predicativity 
issues. For example, do we allow the following type?


Maybe (forall a. f a)

Depending on what language extensions you have on and which version of 
GHC you're using, the answer could be yes or it could be no. There isn't 
a "right answer" per se, it just depends on what you want the semantics 
of the type system to be and what other features you want to have.



Another problem is, I don't think that means what you think it means. 
Supposing we were to allow it, the expanded type of the first instance 
of fix would be:


fix :: (forall a. f a) -> Fix f

Which is isomorphic to

fix :: exists a. f a -> Fix f

Which means that supposing we have some (f A) where A is some unknown 
but defined type, then we can turn it into Fix f. The only way that 
could be possible is if we throw away all the As that occur in the (f 
A). But that's not what you mean, nor what you want.





Alternatively if I could write a function that could turn

e :: forall a. F (F (F ... (F a) ... ))

into

specialize e :: F (F (F ... (F X) ... ))

that would work too, but I don't see how that's possible.


Yeah, that'd be nice. In System F, or in Haskell Core, the "forall a. b" 
is treated like a special version of the function arrow. So we have a 
big lambda for type abstraction (written "/\" below), and we have type 
application (written in Core with "@"). Thus we know that e is eta 
equivalent to:


(/\a. e @a) :: forall a. F (F (F ... (F a) ... ))

This is just like saying that given any function f :: A -> B, it is eta 
equivalent to (\(x::A). f x) :: A -> B.


So if we wanted a version of e monomorphized on a = X, then we'd just say:

e @X :: forall a. F (F (F ... (F X) ... ))

There are tricks for gaining access to the type abstraction and type 
application of Core, but they're all fairly fragile as I recall.


--
Live well,
~wren

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


Re: [Haskell-cafe] Handcranked install of ghc / cabal-install and warning from ghc-pkg check

2012-05-09 Thread Graham Berks
or should I say cabal  

On Wednesday, 9 May 2012 at 21:57, Graham Berks wrote:

> Is there something I have todo to tell ghc about haddock etc ? 
> 
> On Tuesday, 8 May 2012 at 19:13, Graham Berks wrote:
> 
> > Have installed 7.4.1 ghc and 0.14.0 cabal-install and then did alex, happy 
> > & haddock.
> > 
> > When I do a ghc-pkg check I get 
> > 
> > $ ghc-pkg check
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/random-1.0.1.1/html/random.haddock
> >  doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/random-1.0.1.1/html 
> > doesn't exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/zlib-0.5.3.3/html/zlib.haddock
> >  doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/zlib-0.5.3.3/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/HTTP-4000.2.3/html/HTTP.haddock
> >  doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/HTTP-4000.2.3/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/network-2.3.0.11/html/network.haddock
> >  doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/network-2.3.0.11/html 
> > doesn't exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/parsec-3.1.2/html/parsec.haddock
> >  doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/parsec-3.1.2/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/text-0.11.2.0/html/text.haddock
> >  doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/text-0.11.2.0/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/mtl-2.1/html/mtl.haddock 
> > doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/mtl-2.1/html doesn't exist 
> > or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/transformers-0.3.0.0/html/transformers.haddock
> >  doesn't exist or isn't a file
> > Warning: haddock-html: 
> > /usr/local/Cellar/cabal-install/0.14.0/share/doc/transformers-0.3.0.0/html 
> > doesn't exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/share/doc/haddock-2.10.0/html/haddock.haddock doesn't exist or 
> > isn't a file
> > Warning: haddock-html: /usr/local/share/doc/haddock-2.10.0/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/share/doc/xhtml-3000.2.0.5/html/xhtml.haddock doesn't exist or 
> > isn't a file
> > Warning: haddock-html: /usr/local/share/doc/xhtml-3000.2.0.5/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/share/doc/ghc-paths-0.1.0.8/html/ghc-paths.haddock doesn't exist 
> > or isn't a file
> > Warning: haddock-html: /usr/local/share/doc/ghc-paths-0.1.0.8/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/share/doc/mtl-2.1.1/html/mtl.haddock doesn't exist or isn't a 
> > file
> > Warning: haddock-html: /usr/local/share/doc/mtl-2.1.1/html doesn't exist or 
> > isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/share/doc/transformers-0.3.0.0/html/transformers.haddock doesn't 
> > exist or isn't a file
> > Warning: haddock-html: /usr/local/share/doc/transformers-0.3.0.0/html 
> > doesn't exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/share/doc/QuickCheck-2.4.2/html/QuickCheck.haddock doesn't exist 
> > or isn't a file
> > Warning: haddock-html: /usr/local/share/doc/QuickCheck-2.4.2/html doesn't 
> > exist or isn't a directory
> > Warning: haddock-interfaces: 
> > /usr/local/share/doc/random-1.0.1.1/html/random.haddock doesn't exist or 
> > isn't a file
> > Warning: haddock-html: /usr/local/share/doc/random-1.0.1.1/html doesn't 
> > exist or isn't a directory
> > 
> > 
> > Any suggestions to fix this ? 
> > 
> > Thanks 
> 

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


Re: [Haskell-cafe] Handcranked install of ghc / cabal-install and warning from ghc-pkg check

2012-05-09 Thread Graham Berks
Is there something I have todo to tell ghc about haddock etc ? 


On Tuesday, 8 May 2012 at 19:13, Graham Berks wrote:

> Have installed 7.4.1 ghc and 0.14.0 cabal-install and then did alex, happy & 
> haddock.
> 
> When I do a ghc-pkg check I get 
> 
> $ ghc-pkg check
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/random-1.0.1.1/html/random.haddock
>  doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/random-1.0.1.1/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/zlib-0.5.3.3/html/zlib.haddock
>  doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/zlib-0.5.3.3/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/HTTP-4000.2.3/html/HTTP.haddock
>  doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/HTTP-4000.2.3/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/network-2.3.0.11/html/network.haddock
>  doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/network-2.3.0.11/html 
> doesn't exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/parsec-3.1.2/html/parsec.haddock
>  doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/parsec-3.1.2/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/text-0.11.2.0/html/text.haddock
>  doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/text-0.11.2.0/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/mtl-2.1/html/mtl.haddock 
> doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/mtl-2.1/html doesn't exist 
> or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/transformers-0.3.0.0/html/transformers.haddock
>  doesn't exist or isn't a file
> Warning: haddock-html: 
> /usr/local/Cellar/cabal-install/0.14.0/share/doc/transformers-0.3.0.0/html 
> doesn't exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/share/doc/haddock-2.10.0/html/haddock.haddock doesn't exist or 
> isn't a file
> Warning: haddock-html: /usr/local/share/doc/haddock-2.10.0/html doesn't exist 
> or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/share/doc/xhtml-3000.2.0.5/html/xhtml.haddock doesn't exist or 
> isn't a file
> Warning: haddock-html: /usr/local/share/doc/xhtml-3000.2.0.5/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/share/doc/ghc-paths-0.1.0.8/html/ghc-paths.haddock doesn't exist 
> or isn't a file
> Warning: haddock-html: /usr/local/share/doc/ghc-paths-0.1.0.8/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: /usr/local/share/doc/mtl-2.1.1/html/mtl.haddock 
> doesn't exist or isn't a file
> Warning: haddock-html: /usr/local/share/doc/mtl-2.1.1/html doesn't exist or 
> isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/share/doc/transformers-0.3.0.0/html/transformers.haddock doesn't 
> exist or isn't a file
> Warning: haddock-html: /usr/local/share/doc/transformers-0.3.0.0/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/share/doc/QuickCheck-2.4.2/html/QuickCheck.haddock doesn't exist 
> or isn't a file
> Warning: haddock-html: /usr/local/share/doc/QuickCheck-2.4.2/html doesn't 
> exist or isn't a directory
> Warning: haddock-interfaces: 
> /usr/local/share/doc/random-1.0.1.1/html/random.haddock doesn't exist or 
> isn't a file
> Warning: haddock-html: /usr/local/share/doc/random-1.0.1.1/html doesn't exist 
> or isn't a directory
> 
> 
> Any suggestions to fix this ? 
> 
> Thanks 

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


Re: [Haskell-cafe] [Q] multiparam class undecidable types

2012-05-09 Thread Matthias Fischmann


Thanks Oleg,

that was very helpful.  i can work with that.  read the rest of this
if you are curious where your hints took me.

you are right, I need to make the functional dependency explicit:

| class Table t c | t -> c where
|   toLists   :: t -> [[c]]
|   fromLists :: [[c]] -> t
| 
| instance Table [[c]] c where
|   toLists   = id
|   fromLists = id
| 
| instance (Table t c, Show c) => Show t where
|   showsPrec p t = showParen (p > 10) $ showString "fromLists " . shows (head 
. head $ toLists t)

this compiles, and 'show' prints the first cell of each table.  i also
understand now why i can't just print all of them: [[Int]] is one of
the types where the instances overlap.

| instance Show Int
| instance Show a => Show [a]

vs.

| instance Table [[Int]] Int
| instance (Table [[Int]] Int, Show Int) => Show [[Int]]

the advanced overlap code you are referencing below is fascinating,
but isn't it a different problem?  i don't want to distinguish
different the cases "Show c" and "Typeable c", but i want to use
whatever instance of "Show c" is available to implement "Show t".

i can't make your solution work for this, because one of the two
overlapping instances (namely "Show a => Show [a]") is already
provided by the surrounding code that i cannot outfit with the
advanced overlap trick.  or am i missing something here?

i think what i will do is to instantiate all table types individually:

| instance Show c => Show (SimpleTable c) where
|   showsPrec p t = showParen (p > 10) $ showString "FastTable " .
| shows (toLists t)

cheers,
matthias



On Wed, May 09, 2012 at 06:41:00AM -, o...@okmij.org wrote:
> Date: 9 May 2012 06:41:00 -
> From: o...@okmij.org
> To: f...@etc-network.de
> CC: haskell-cafe@haskell.org
> Subject: Re: [Q] multiparam class undecidable types 
> 
> 
> > | instance (Table a c, Show c) => Show a where
> > I would have thought that there is on overlap: the instance in my code
> > above defines how to show a table if the cell is showable;
> 
> No, the instance defines how to show values of any type; that type
> must be an instance of Table. There is no `if' here: instances are
> selected regardless of the context such as (Table a c, Show c)
> above. The constraints in the context apply after the selection, not
> during.
> 
> Please see 
>   ``Choosing a type-class instance based on the context''
>   http://okmij.org/ftp/Haskell/TypeClass.html#class-based-overloading
> 
> for the explanation and the solution to essentially the same problem.
> 
> There are other problems with the instance:
> 
> | instance (Table a c, Show c) => Show a where
> 
> For example, there is no information for the type checker to determine
> the type c. Presumably there could be instances
>   Table [[Int]] Int
>   Table [[Int]] Bool
> So, when the a in (Table a c) is instantiated to [[Int]] 
> there could be two possibilities for c: Int and Bool. You can argue
> that the type of the table uniquely determines the type of its
> cells. You should tell the type checker of that, using functional
> dependencies or associated types:
> 
>   class Table table where
> type Cell table :: *
> toLists :: table -> [[Cell table]]
> 
> 
> 

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


[Haskell-cafe] Haskell Hackathon in Munich

2012-05-09 Thread Heinrich Hördegen

Dear all,

this is a reminder of our local haskell Hackathon in Munich, Germany, 
which will be held on Saturday, the 12th of May. If you plan to join, 
check out the details at:


http://www.haskell-munich.de/dates

or contact me. We hope to see you on Saturday,
Heinrich


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


Re: [Haskell-cafe] cabal issue

2012-05-09 Thread Graham Berks
Have solved the issue with help from JP Moresmau.

Used the command 

cabal install --dry-run --verbose=3 --global build wrapper

And this gave enough detailed info to enable me to remove the conflict and 
resolve the issue.

Thanks goes to JP !


On Wednesday, 9 May 2012 at 09:55, Graham Berks wrote:

> Given that I have the dependant packages already installed when I do 
> 
> $ cabal install --dry-run --global buildwrapper Resolving dependencies... In 
> order, the following would be installed: mtl-2.1.1 (new version) 
> aeson-0.6.0.2 (reinstall) changes: mtl-2.0.1.0 -> 2.1.1 parsec-3.1.2 
> (reinstall) changes: mtl-2.0.1.0 -> 2.1.1 regex-base-0.93.2 (reinstall) 
> changes: mtl-2.0.1.0 -> 2.1.1 regex-tdfa-1.1.8 (reinstall) changes: 
> mtl-2.0.1.0 -> 2.1.1 buildwrapper-0.5.2 (new package)
> 
> And that build wrapper doesn't have a defined dependency version number for 
> MTL 
> can someone tell me why cabal is trying to install a new version of MTL ?
> 
> Thanks 

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


[Haskell-cafe] cabal issue

2012-05-09 Thread Graham Berks
Given that I have the dependant packages already installed when I do 

$ cabal install --dry-run --global buildwrapper Resolving dependencies... In 
order, the following would be installed: mtl-2.1.1 (new version) aeson-0.6.0.2 
(reinstall) changes: mtl-2.0.1.0 -> 2.1.1 parsec-3.1.2 (reinstall) changes: 
mtl-2.0.1.0 -> 2.1.1 regex-base-0.93.2 (reinstall) changes: mtl-2.0.1.0 -> 
2.1.1 regex-tdfa-1.1.8 (reinstall) changes: mtl-2.0.1.0 -> 2.1.1 
buildwrapper-0.5.2 (new package)

And that build wrapper doesn't have a defined dependency version number for MTL 
can someone tell me why cabal is trying to install a new version of MTL ?

Thanks 

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


Re: [Haskell-cafe] Annotaing abstract syntax trees

2012-05-09 Thread José Pedro Magalhães
Hi Romildo,

I had a quick look at your code. In general it seems fine, although I
haven't tested it. You might want to use HLint to give you coding tips.

I don't understand your remark about wanting the "type checker to produce
an expression annotated with both positions and calculated types". Can't
you make `exprTypeCheck` operate on `Ann (Range, ExprType) ExprF` instead
of just `Ann ExprType ExprF`?


Cheers,
Pedro

[1] http://community.haskell.org/~ndm/hlint/

On Tue, May 8, 2012 at 3:05 PM, José Romildo Malaquias
wrote:

> Hello.
>
> I am reading Martijn's MSc Thesis "Generic Selections of
> Subexpressions", where one can found some discussions about annotating
> abstract syntax trees (AST).
>
> In order to follow the discussion I wrote the attached Haskell program,
> which is an interpreter for an simple typed expression language. The
> Annotations package is used.
>
> The expression pattern is represented by a single recursive data
> type. Annotations are used for positions in the input source, and also
> for the type of expressions and subexpressions.
>
> I would like somebody to review the code and comment on it, as I am not
> sure I am using the concepts right.
>
> Also I would like the type checker to produce an expression annotated
> with both positions and calculated types. Currently it discards the
> position annotations. Any sugestions on how to modify it is welcome.
>
> Next step is adding a new form of expression to introduce local variable
> bindings.
>
> After that I want to start working with ASTs represented by mutually
> recursive data types. Then I will need multirec...
>
> Romildo
>
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe