Re: can't run Grapefruit

2009-05-28 Thread Peter Gavin
On Sat, May 23, 2009 at 3:58 PM, Dean Herington
heringtonla...@mindspring.com wrote:
 GHCi, version 6.10.1: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer ... linking ... done.
 Loading package base ... linking ... done.
 Prelude :m + Graphics.UI.Grapefruit.Circuit
 Prelude Graphics.UI.Grapefruit.Circuit :m + Graphics.UI.Grapefruit.GTK
 Prelude Graphics.UI.Grapefruit.Circuit Graphics.UI.Grapefruit.GTK :m +
 Examples.Grapefruit.Simple
 Prelude Graphics.UI.Grapefruit.Circuit Graphics.UI.Grapefruit.GTK
 Examples.Grapefruit.Simple run GTK mainCircuit
 Loading package syb ... linking ... done.
 Loading package base-3.0.3.0 ... linking ... done.
 Loading package array-0.2.0.0 ... linking ... done.
 Loading package containers-0.2.0.0 ... linking ... done.
 Loading package bytestring-0.9.1.4 ... linking ... done.
 Loading package old-locale-1.0.0.1 ... linking ... done.
 Loading package old-time-1.0.0.1 ... linking ... done.
 Loading package random-1.0.0.1 ... linking ... done.
 Loading package Win32-2.2.0.0 ... linking ... done.
 Loading package filepath-1.1.0.1 ... linking ... done.
 Loading package directory-1.0.0.2 ... linking ... done.
 Loading package process-1.0.1.0 ... linking ... done.
 Loading package haskell98 ... linking ... done.
 Loading package mtl-1.1.0.2 ... linking ... done.
 Loading package glib-0.10.0 ... can't load .so/.DLL for: intl (addDLL: could
 not load DLL)

Hi Dean,

First, you should try using the newest version of the installer
(0.10.1, it requires GHC 6.10.3).  Second, you should check whether
intl.dll exists in c:\gtk2hs\0.10.x\bin, and that c:\gtk2hs\0.10.x\bin
is also in your PATH.  If you're still having problems, please paste
the contents of c:\gtk2hs\0.10.x\lib\gtk2hs\{gtk,glib}.package.conf.
Please also make sure the libraries listed in the extra-libraries
field and extra-ghci-libraries field exist in c:\gtk2hs\0.10.x\lib and
c:\gtk2hs\0.10.x\bin respectively.

Pete
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: rebinding arrow notation

2008-09-04 Thread Peter Gavin

Simon Peyton-Jones wrote:

| Section 8.3.5 of the documentation says:
|
|Arrow notation (see Section 8.9, “Arrow notation ”) uses whatever arr, 
(),
|first, app, (|||) and loop functions are in scope. But unlike the other
|constructs, the types of these functions must match the Prelude types very
|closely. Details are in flux; if you want to use this, ask!
|
| I want to do this.  Is there anything special I should know?

To be honest I believe I wrote those words some years ago, so I no longer have a clue 
what the flux was.  My suggestion would be to try it, starting with small 
examples, and we can go from there.

The other thing to say is that the arrow code is Ross Patterson's, and regret 
to say that it's one part of GHC's code base that I do not grok in fullness.  
So before you commit to really needing this feature, check that either (a) it 
works or (b) Ross is willing to fix it (I'll help of course).


Ok.  I guess I'm basically going to write the arrow version of the rmonad 
library on hackage.  I'll let you know if I have any problems along the way.  If 
it turns out I don't have any problems, I'll let you know that, too :)


Pete
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


rebinding arrow notation

2008-09-02 Thread Peter Gavin

Section 8.3.5 of the documentation says:

  Arrow notation (see Section 8.9, “Arrow notation ”) uses whatever arr, (),
  first, app, (|||) and loop functions are in scope. But unlike the other
  constructs, the types of these functions must match the Prelude types very
  closely. Details are in flux; if you want to use this, ask!

I want to do this.  Is there anything special I should know?

Pete
___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users


Re: [Haskell-cafe] Re: Arrow without `'

2008-09-02 Thread Peter Gavin

Valery V. Vorotyntsev wrote:

On 1/23/08, David Menendez [EMAIL PROTECTED] wrote:

On Jan 23, 2008 12:20 PM, Valery V. Vorotyntsev [EMAIL PROTECTED] wrote:

I've built GHC from darcs, and...
Could anybody tell me, what's the purpose of Arrow[1] not having `'
method?

It's derived from the Category superclass.


Yes, it is.

The right question: how to build `arrows' in such circumstances?

Here go 2 changes I made to `CoState.hs' accompanied by the
error messages. :) Unfortunately, I'm not arrow-capable enough to
make _proper_ changes to the code and satisfy GHC... Any help?



Well, without looking at your code, generally all you have to do is

1) move the definition of () to Category and rename it to (.) after flipping 
the arguments.

2) define the id method of Category which is just (arr id) or returnA.

So essentially

instance Arrow (Foo a) where
  a  b = compose a b
  pure f = ...
  first a = ...

becomes

instance Arrow (Foo a) where
  pure f = ...
  first a = ...

instance Category (Foo a) where
  id = arr id
  a . b = compose b a

That's it.  It's too bad there's no way to do this automatically in the 
libraries, but it could be noted in the API docs.


Pete


~~
Change #1:

$ darcs w Control/Arrow/Transformer/CoState.hs
What's new in Control/Arrow/Transformer/CoState.hs:

{
hunk ./Control/Arrow/Transformer/CoState.hs 23
+import Control.Category (())
}

--
Error #1:

Control/Arrow/Transformer/CoState.hs:29:7:
`' is not a (visible) method of class `Arrow'
Failed, modules loaded: Control.Arrow.Operations.

~~
Change #2:

$ darcs diff -u Control/Arrow/Transformer/CoState.hs
--- old-arrows/Control/Arrow/Transformer/CoState.hs 2008-01-24
14:54:29.852296559 +0200
+++ new-arrows/Control/Arrow/Transformer/CoState.hs 2008-01-24
14:54:29.852296559 +0200
@@ -20,12 +20,13 @@

 import Control.Arrow
 import Control.Arrow.Operations
+import Control.Category (())

  newtype CoStateArrow s a b c = CST (a (s - b) (s - c))

  instance Arrow a = Arrow (CoStateArrow s a) where
arr f = CST (arr (f .))
-   CST f  CST g = CST (f  g)
+-- CST f  CST g = CST (f  g)
first (CST f) = CST (arr unzipMap  first f  arr zipMap)

  zipMap :: (s - a, s - b) - (s - (a,b))

--
Error#2:

Control/Arrow/Transformer/CoState.hs:27:0:
Could not deduce (Control.Category.Category (CoStateArrow s a))
  from the context (Arrow a)
  arising from the superclasses of an instance declaration
   at Control/Arrow/Transformer/CoState.hs:27:0
Possible fix:
  add (Control.Category.Category
 (CoStateArrow s a)) to the context of
the instance declaration
  or add an instance declaration for
 (Control.Category.Category (CoStateArrow s a))
In the instance declaration for `Arrow (CoStateArrow s a)'
Failed, modules loaded: Control.Arrow.Operations.

Thank you.



___
Glasgow-haskell-users mailing list
Glasgow-haskell-users@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users