[Haskell-cafe] Re: Installing Haskell on OSX

2010-06-21 Thread Sudish Joseph
Antoine Latter aslat...@gmail.com writes:
 On Sun, Jun 20, 2010 at 12:53 PM, Giuseppe Luigi Punzi Ruiz
 glpu...@lordzealon.com wrote:
 Hi again,

 Yes, you are right, but now, cabal install leksah I get:


[...]

 Undefined symbols:
  _iconv_close, referenced from:
      _hs_iconv_close in libHSbase-4.2.0.0.a(iconv.o)
  _iconv_open, referenced from:
      _hs_iconv_open in libHSbase-4.2.0.0.a(iconv.o)
  _iconv, referenced from:
      _hs_iconv in libHSbase-4.2.0.0.a(iconv.o)
 ld: symbol(s) not found

 This one is a bummer, and I see it all the time when I try to build a
 package linked against macports.

This is caused by the two libiconv's in the system being
ABI-incompatible, sadly.  The ghc pkg available for download from
haskell.org is linked against the system /usr/lib/libiconv.dynlib, which
has iconv_open() as a function.  Macports has GNU libiconv which
#defines iconv_open to libiconv_open() in /opt/local/include/iconv.h.

This then blows up as above when linking against other libraries in
macports - the linker pulls in GNU libiconv which lacks the symbols
needed as you see above.

One workaround is to link GHC itself against the macports version of
libiconv (and libgmp) and have cabal-install link all subsequent
libraries against macports.  I did just that this weekend and now have a
working threadscope using the Quartz backend for gtk2, which is very
nice (no need to run the X server).

Recipe for reproducing this build is included below (and I can also
provide the resulting ghc-6.12.3 pkg file if needed).

Another possible option is to use Homebrew to install gtk2 and other
dependencies.  Homebrew prefers to use the system-provided libraries and
will not pull in GNU libiconv, so this should work with the existing GHC
pkg in theory.  I didn't pursue this since the homebrew 'gtk+' package
didn't seem to have the option to use Quartz instead of X11 as its
backend.

Steps for linking the ghc runtime against macports:

-  Specify EXTRA_CABAL_CONFIGURE_FLAGS in mk/build.mk as mentioned at
   the bottom of http://www.haskell.org/ghc/download_ghc_6_12_3.html

   EXTRA_CABAL_CONFIGURE_FLAGS = --extra-include-dirs=/opt/local/include \
 --extra-lib-dirs=/opt/local/lib

-  Use the --with-iconv-* and --with-gmp-* flags when configuring ghc.

   ./configure --with-iconv-includes=/opt/local/include \
   --with-iconv-libraries=/opt/local/lib \
   --with-gmp-includes=/opt/local/include \
   --with-gmp-libraries=/opt/local/lib

-  This produces a GHC runtime and libraries linked against macports:

   % otool -L ghc
   ghc:
/opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current 
version 5.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
version 125.2.0)
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
version 8.0.0)
/opt/local/lib/libgmp.10.dylib (compatibility version 11.0.0, current 
version 11.1.0)

   % nm HSbase-4.2.0.2.o | fgrep iconv
   001ff7f0 T _hs_iconv
   001ff7e0 T _hs_iconv_close
   001ff800 T _hs_iconv_open
U _libiconv
U _libiconv_close
U _libiconv_open

   ghc and included libraries use the macports libiconv, so linking
   against other libraries in macports (gtk2!) will work.

-  Have cabal-install use macports as well for packages it installs by
   editing ~/.cabal/config and setting:

   extra-include-dirs: /opt/local/include
   extra-lib-dirs: /opt/local/lib

-  This gives, for e.g., threadscope linked against macports:

   % otool -L ~/.cabal/bin/threadscope | egrep '(gtk|iconv)'
/opt/local/lib/libgtk-quartz-2.0.0.dylib (compatibility version 
2001.0.0, current version 2001.1.0)
/opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
version 8.0.0)

-  Note that since the ghc runtime is still in 32-bit i386 mode, we
   need universal versions of most libraries in macports.  Recent
   versions of macports (1.9 for sure, maybe 1.8) make it simple to
   switch from an x86_64 library to a universal one:

   % port install gtk2 +universal

   This will recompile gtk2 and *all* dependent libraries as universal
   libraries which is exactly what you need.  You can then eliminate any
   inactive 64-bit libraries with:

   % port -f uninstall inactive

 Here's the last thread about with, with more links and discussion:

 http://thread.gmane.org/gmane.comp.lang.haskell.general/18064/

 The response by Jean-Marie Gaillourdet has worked for me in the past.

 Antoine

Thanks for that link, I didn't think of overriding libiconv on a
per-package basis.

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


[Haskell-cafe] MonadCatchIO-transformers and ContT

2010-06-21 Thread Michael Snoyman
Hi cafe,

I ran into a segfault while working on some database code. I eventually
traced it back to a double-finalizing of a statement (read: freeing memory
twice), which ultimately led back to switching my code to use the ContT
monad transformer. I was able to isolate this down to a minimal test case
(catch.hs); when run, it prints the line released twice.

In an attempt to understand what's going on, I rewrote the code to avoid the
libraries entirely (catch-simplified.hs); it didn't give me any insight into
the problem, but maybe it will help someone else.

If someone sees an obvious mistake I'm making in my usage of the bracket_
function, please let me know. Otherwise, I'd really like to get a fix for
this so I can use this library.

Thanks,
Michael
{-# LANGUAGE PackageImports #-}

import qualified MonadCatchIO-transformers Control.Monad.CatchIO as C
import Control.Monad.IO.Class
import Control.Monad.Trans.Cont

f :: ContT (Either String String) IO String
f = do
C.bracket_ (say acquired) (say released) (say executed)
() - error error
return success
  where
say = liftIO . putStrLn

main :: IO ()
main = flip runContT (return . Right) f = print
{-# LANGUAGE PackageImports #-}

import qualified Control.Exception as E

cthrow :: E.SomeException - ContT a
cthrow = cliftIO . E.throwIO

cliftIO :: IO a - ContT a
cliftIO m = (m =)

ccatch :: ContT a
   - (E.SomeException - ContT a)
   - ContT a
ccatch m f c = m c `E.catch` flip f c

type ContT a = (a - IO Bool) - IO Bool

creturn :: a - ContT a
creturn a = ($ a)

cbind :: ContT a - (a - ContT b) - ContT b
cbind m k c = m $ flip k c

cbind' :: ContT a - ContT b - ContT b
cbind' m k c = m $ const $ k c

conException :: ContT a - ContT b - ContT a
conException a onEx = a `ccatch` (\e - onEx `cbind'` cthrow e)

cbracket_ ::
ContT a
 - ContT b
 - ContT c
 - ContT c
cbracket_ before after thing =
  before
  `cbind'`
  thing `conException` after
  `cbind`
  \r - after
  `cbind'`
  creturn r

f :: ContT String
f =
cbracket_ (say acquired) (say released) (say executed)
`cbind'`
error error
`cbind'`
creturn success
  where
say = cliftIO . putStrLn

main :: IO ()
main = f (return . null) = print
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Installing Haskell on OSX

2010-06-21 Thread Giuseppe Luigi Punzi
I died in more dependencies. One, ige-mac-integration. To avoid possible 
problems I uninstall all ports last night to reinstall full gtk2 with quartz.

For now, i'm solving all of this and I hope to get it working this night.

Sudish Joseph sud...@gmail.com wrote:

Antoine Latter aslat...@gmail.com writes:
 On Sun, Jun 20, 2010 at 12:53 PM, Giuseppe Luigi Punzi Ruiz
 glpu...@lordzealon.com wrote:
 Hi again,

 Yes, you are right, but now, cabal install leksah I get:


[...]

 Undefined symbols:
  _iconv_close, referenced from:
      _hs_iconv_close in libHSbase-4.2.0.0.a(iconv.o)
  _iconv_open, referenced from:
      _hs_iconv_open in libHSbase-4.2.0.0.a(iconv.o)
  _iconv, referenced from:
      _hs_iconv in libHSbase-4.2.0.0.a(iconv.o)
 ld: symbol(s) not found

 This one is a bummer, and I see it all the time when I try to build a
 package linked against macports.

This is caused by the two libiconv's in the system being
ABI-incompatible, sadly.  The ghc pkg available for download from
haskell.org is linked against the system /usr/lib/libiconv.dynlib, which
has iconv_open() as a function.  Macports has GNU libiconv which
#defines iconv_open to libiconv_open() in /opt/local/include/iconv.h.

This then blows up as above when linking against other libraries in
macports - the linker pulls in GNU libiconv which lacks the symbols
needed as you see above.

One workaround is to link GHC itself against the macports version of
libiconv (and libgmp) and have cabal-install link all subsequent
libraries against macports.  I did just that this weekend and now have a
working threadscope using the Quartz backend for gtk2, which is very
nice (no need to run the X server).

Recipe for reproducing this build is included below (and I can also
provide the resulting ghc-6.12.3 pkg file if needed).

Another possible option is to use Homebrew to install gtk2 and other
dependencies.  Homebrew prefers to use the system-provided libraries and
will not pull in GNU libiconv, so this should work with the existing GHC
pkg in theory.  I didn't pursue this since the homebrew 'gtk+' package
didn't seem to have the option to use Quartz instead of X11 as its
backend.

Steps for linking the ghc runtime against macports:

-  Specify EXTRA_CABAL_CONFIGURE_FLAGS in mk/build.mk as mentioned at
   the bottom of http://www.haskell.org/ghc/download_ghc_6_12_3.html

   EXTRA_CABAL_CONFIGURE_FLAGS = --extra-include-dirs=/opt/local/include \
 --extra-lib-dirs=/opt/local/lib

-  Use the --with-iconv-* and --with-gmp-* flags when configuring ghc.

   ./configure --with-iconv-includes=/opt/local/include \
   --with-iconv-libraries=/opt/local/lib \
   --with-gmp-includes=/opt/local/include \
   --with-gmp-libraries=/opt/local/lib

-  This produces a GHC runtime and libraries linked against macports:

   % otool -L ghc
   ghc:
   /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, current 
 version 5.0.0)
   /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
 version 125.2.0)
   /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
 version 8.0.0)
   /opt/local/lib/libgmp.10.dylib (compatibility version 11.0.0, current 
 version 11.1.0)

   % nm HSbase-4.2.0.2.o | fgrep iconv
   001ff7f0 T _hs_iconv
   001ff7e0 T _hs_iconv_close
   001ff800 T _hs_iconv_open
U _libiconv
U _libiconv_close
U _libiconv_open

   ghc and included libraries use the macports libiconv, so linking
   against other libraries in macports (gtk2!) will work.

-  Have cabal-install use macports as well for packages it installs by
   editing ~/.cabal/config and setting:

   extra-include-dirs: /opt/local/include
   extra-lib-dirs: /opt/local/lib

-  This gives, for e.g., threadscope linked against macports:

   % otool -L ~/.cabal/bin/threadscope | egrep '(gtk|iconv)'
   /opt/local/lib/libgtk-quartz-2.0.0.dylib (compatibility version 
 2001.0.0, current version 2001.1.0)
   /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
 version 8.0.0)

-  Note that since the ghc runtime is still in 32-bit i386 mode, we
   need universal versions of most libraries in macports.  Recent
   versions of macports (1.9 for sure, maybe 1.8) make it simple to
   switch from an x86_64 library to a universal one:

   % port install gtk2 +universal

   This will recompile gtk2 and *all* dependent libraries as universal
   libraries which is exactly what you need.  You can then eliminate any
   inactive 64-bit libraries with:

   % port -f uninstall inactive

 Here's the last thread about with, with more links and discussion:

 http://thread.gmane.org/gmane.comp.lang.haskell.general/18064/

 The response by Jean-Marie Gaillourdet has worked for me in the past.

 Antoine

Thanks for that link, I didn't think of overriding libiconv on a
per-package basis.

-Sudish
___
Haskell-Cafe 

Re: [Haskell-cafe] MonadCatchIO-transformers and ContT

2010-06-21 Thread Neil Brown

Hi,

Here's my guess.  Take a look at this version, and try running it:

===
{-# LANGUAGE PackageImports #-}

import qualified MonadCatchIO-transformers Control.Monad.CatchIO as C
import Control.Monad.IO.Class
import Control.Monad.Trans.Cont


bracket_' :: C.MonadCatchIO m
 = m a  -- ^ computation to run first (\acquire resource\)
 - m b  -- ^ computation to run last when successful 
(\release resource\)

 - m b  -- ^ computation to run last when an exception occurs
 - m c  -- ^ computation to run in-between
 - m c  -- returns the value from the in-between computation
bracket_' before after afterEx thing = C.block $ do
  _ - before
  r - C.unblock thing `C.onException` afterEx
  _ - after
  return r


f :: ContT (Either String String) IO String
f = do
bracket_' (say acquired) (say released-successful) (say 
released-exception) (say executed)

say Hello!
() - error error
return success
  where
say = liftIO . putStrLn

main :: IO ()
main = flip runContT (return . Right) f = print
===

I get:

acquired
executed
released-successful
Hello!
released-exception
Tmp.hs: error

So the exception handler is running after the code that follows the 
whole bracket_' call -- and after the bracket_' call has completed 
succesfully!


Here's my speculation, based on glancing at the libraries involved: I 
believe the reason for this may be the MonadCatchIO instance for ContT:


===
instance MonadCatchIO m = MonadCatchIO (ContT r m) where
  m `catch` f = ContT $ \c - runContT m c `catch` \e - runContT (f e) c
===

To my eye, that code takes the continuation to run after the block, c 
(which in your case involves the after-action from bracket_, and then 
the error), and runs that inside the catch block.  This causes a 
successful completion of bracket_ (first release), followed by the 
error, which triggers the catch block which then runs the final actions 
(second release) and rethrows the error.  Does that sound possible to 
anyone else?


Thanks,

Neil.

On 21/06/10 09:39, Michael Snoyman wrote:

Hi cafe,

I ran into a segfault while working on some database code. I 
eventually traced it back to a double-finalizing of a statement (read: 
freeing memory twice), which ultimately led back to switching my code 
to use the ContT monad transformer. I was able to isolate this down to 
a minimal test case (catch.hs); when run, it prints the line 
released twice.


In an attempt to understand what's going on, I rewrote the code to 
avoid the libraries entirely (catch-simplified.hs); it didn't give me 
any insight into the problem, but maybe it will help someone else.


If someone sees an obvious mistake I'm making in my usage of the 
bracket_ function, please let me know. Otherwise, I'd really like to 
get a fix for this so I can use this library.


Thanks,
Michael


___
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] installation problem with cabal

2010-06-21 Thread Louis Plissonneau
Hi,

when I install packages from cabal, the package manager installs already
installed files (some of his favorites are process and haskell98)
so these packages are both system and user installed (that can cause later
dependency problems, but the cabal FAQ explains very well how to recover
from it)

but the funniest is that if I reinstall it, it again reinstall the same
packages even they are already twice installed

does anyone know how to solve this issue?

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


Re: [Haskell-cafe] MonadCatchIO-transformers and ContT

2010-06-21 Thread Michael Snoyman
I think you're correct, but I still don't know how to solve it. Any thoughts
on that front? I'm at the point of just attaching a finalizer to the
statement, or sticking in an IORef to ensure it doesn't get
double-finalized.

On Mon, Jun 21, 2010 at 2:04 PM, Neil Brown nc...@kent.ac.uk wrote:

  Hi,

 Here's my guess.  Take a look at this version, and try running it:

 ===
 {-# LANGUAGE PackageImports #-}

 import qualified MonadCatchIO-transformers Control.Monad.CatchIO as C
 import Control.Monad.IO.Class
 import Control.Monad.Trans.Cont


 bracket_' :: C.MonadCatchIO m
  = m a  -- ^ computation to run first (\acquire resource\)
  - m b  -- ^ computation to run last when successful (\release
 resource\)
  - m b  -- ^ computation to run last when an exception occurs
  - m c  -- ^ computation to run in-between
  - m c  -- returns the value from the in-between computation
 bracket_' before after afterEx thing = C.block $ do
   _ - before
   r - C.unblock thing `C.onException` afterEx
   _ - after
   return r


 f :: ContT (Either String String) IO String
 f = do
 bracket_' (say acquired) (say released-successful) (say
 released-exception) (say executed)
 say Hello!
 () - error error
 return success
   where
 say = liftIO . putStrLn

 main :: IO ()
 main = flip runContT (return . Right) f = print
 ===

 I get:

 acquired
 executed
 released-successful
 Hello!
 released-exception
 Tmp.hs: error

 So the exception handler is running after the code that follows the whole
 bracket_' call -- and after the bracket_' call has completed succesfully!

 Here's my speculation, based on glancing at the libraries involved: I
 believe the reason for this may be the MonadCatchIO instance for ContT:

 ===
 instance MonadCatchIO m = MonadCatchIO (ContT r m) where
   m `catch` f = ContT $ \c - runContT m c `catch` \e - runContT (f e) c
 ===

 To my eye, that code takes the continuation to run after the block, c
 (which in your case involves the after-action from bracket_, and then the
 error), and runs that inside the catch block.  This causes a successful
 completion of bracket_ (first release), followed by the error, which
 triggers the catch block which then runs the final actions (second release)
 and rethrows the error.  Does that sound possible to anyone else?

 Thanks,

 Neil.


 On 21/06/10 09:39, Michael Snoyman wrote:

 Hi cafe,

  I ran into a segfault while working on some database code. I eventually
 traced it back to a double-finalizing of a statement (read: freeing memory
 twice), which ultimately led back to switching my code to use the ContT
 monad transformer. I was able to isolate this down to a minimal test case
 (catch.hs); when run, it prints the line released twice.

  In an attempt to understand what's going on, I rewrote the code to avoid
 the libraries entirely (catch-simplified.hs); it didn't give me any insight
 into the problem, but maybe it will help someone else.

  If someone sees an obvious mistake I'm making in my usage of the bracket_
 function, please let me know. Otherwise, I'd really like to get a fix for
 this so I can use this library.

  Thanks,
 Michael


 ___
 Haskell-Cafe mailing 
 listhaskell-c...@haskell.orghttp://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] MonadCatchIO-transformers and ContT

2010-06-21 Thread David Menendez
On Mon, Jun 21, 2010 at 7:04 AM, Neil Brown nc...@kent.ac.uk wrote:

 Here's my speculation, based on glancing at the libraries involved: I
 believe the reason for this may be the MonadCatchIO instance for ContT:

 ===
 instance MonadCatchIO m = MonadCatchIO (ContT r m) where
   m `catch` f = ContT $ \c - runContT m c `catch` \e - runContT (f e) c
 ===

 To my eye, that code takes the continuation to run after the block, c (which
 in your case involves the after-action from bracket_, and then the error),
 and runs that inside the catch block.  This causes a successful completion
 of bracket_ (first release), followed by the error, which triggers the catch
 block which then runs the final actions (second release) and rethrows the
 error.  Does that sound possible to anyone else?

Sounds possible to me.

ContT does not play well with control operations from other monads.
Most people would expect, e.g., lift m `catch` lift . f = lift (m
`catch` f), but ContT does not have such an operation.

If you really want explicit continuations and exceptions, you need a
monad written specifically for that.

-- 
Dave Menendez d...@zednenem.com
http://www.eyrie.org/~zednenem/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: How to browse code written by others

2010-06-21 Thread Peter Hercek

On 06/20/2010 11:05 AM, Claus Reinke wrote:
I think Luke means that if you use qualified names then hothasktags 
can give you better location information than current ghci ctags.


GHCi :ctags doesn't output tags for qualified names (though it
probably should), but that isn't enough for proper handling of
qualified imports. I believe hothasktags is meant to output
multiple tags per target, one for each module referencing the
target.


I understand it that way too.



But that would rely on scoped tags.


By scoped tags, I understand tags valid only in the given scope (which 
is a file for the sake of qualified imports) which is the same as static 
tags which are supposed to be valid inside a file too ... but they are 
not as I found out from your example later :-(



I discussed this with Luke before and I sumarrized what would need to 
be done to imporove ghci ctags to support qualified names better. 
Here is the post which explains it with an example:


http://permalink.gmane.org/gmane.comp.lang.haskell.cafe/73116


The problem with that example is that all occurrences of B.x point
to b.hs and C.x always points to c.hs, so it doesn't test the scoping
aspect of static tags. For instance, if you are in b.hs, and try ':tag 
C.x',

you'll still be sent to c.hs, even though that isn't in scope (see also
':help tag-priority').


Yes, but this is the way vim works. Vim jumps even when given tag is not 
in scope. C.x is not in scope in b.hs (not as a static nor as a global 
symbol) so vim gives as static tag in a different file which matches 
exactly. Which looks like a reasonable feature for non-hierarchical 
symbols (maybe one is missing an include/import). Well, maybe not so 
much for jumps to tags but definitely usefull in :tselect. If we would 
use hierarchical names for tags then this is not so good and it works 
poorly (if I can say it works at all) for tag completions (^X^]).




If I add a file d.hs that is the same as a.hs but with the qualifiers
exchanged:

module D () where
import qualified B as C
import qualified C as B
localAct = do
 print B.x
 print C.x

and try to add corresponding scoped tags by hand, then I don't
see the scoping being taken into account (though my Vim is old
7.2 from August 2008). Depending on sort order of the tags file,
either all B.x point to b.hs or all B.x point to c.hs. So, one either
gets the wrong pointers in a.hs or in d.hs.


You are correct. I thought this works well. Thanks for pointing it out.
It does not work for me in my vim too, version 7.2 too.
This looks to me like a vim bug. Though vim developers may not think so 
since it is not documented anyway.


So it is really questionable how much do the qualified tags make sense 
in vim. I'm much less of a supporter of scoped tags now :-/ Looks like 
it is not worth the effort.


Peter.

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


Re: [Haskell-cafe] Re: How does one get off haskell?

2010-06-21 Thread Ron Alford
On Fri, Jun 18, 2010 at 10:30 AM, C. McCann c...@uptoisomorphism.net wrote:
 The better question is when do the benefits of static typing outweigh
 the costs imposed?. If you're using Java, the answer is probably
 never, but even in Haskell I don't think the answer is quite
 always.

I have half a concrete example!  I do research in automated planning,
and the standard problem definition language is PDDL[1].
PDDL uses FOL logic expressions for expressing goal conditions, action
preconditions, effects and various other things.  The problem comes in
that it uses a /different/ subset of first-order logic for each
expression, leading to something like 8 or so expression types
contained just in PDDL 3.1 (the latest 'standard').  Then there are
the many previous versions of PDDL, and all the many extensions and
subset/extensions to various versions of PDDL used in other people's
research projects.

So, when I wrote a PDDL library to help with my research, I needed
extensibility.   If not, I'd need to either fork the library for every
PDDL extension, or create some sort of uber-PDDL which contained all
the extensions.  The best I came up with is Wouter's Datatypes a la
Carte [2] which I used along with an extensible record technique my
implementation[3]*.

There are downsides to this approach.  The most obvious is that to
define a function over one of these datatypes, you need to define a
class associated with that function and then define an instance of
that class for every component.
Also, type signatures are huge and I feeling like I'm using half the
language extensions out there.  I end up with a full complement of
boilerplate code, and it doesn't even buy me full expression type
safety (there are restrictions in PDDL on how expressions combine).

Now, one thing I'm missing out of this example is the other side of
the coin - doing it better in a dynamically typed language.  However,
there are plenty of C, lisp, and python PDDL planners out there, and
I'm pretty sure they don't bother with type safe expressions.  Also,
this isn't an indictment of static typing in general.  This only shows
that my task isn't well suited to Haskell's current static typing.

-Ron Alford


* Note that this was my first and only real haskell project, and all
that this entails.

[1] http://en.wikipedia.org/wiki/Planning_Domain_Definition_Language
[2] http://lambda-the-ultimate.org/node/2700
[3] http://www.cs.umd.edu/projects/planning/data/alford09translating/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Installing Haskell on OSX

2010-06-21 Thread Sudish Joseph
Hi,

I ran into one problem worth mentioning while recompiling gtk and its
dependencies as universal libraries using macports: the pango port
refused to build with +universal (it fails when trying to merge the
i386  x86_64 libs).  The pango-devel port does work with one small
tweak as described at https://trac.macports.org/ticket/22801.

Essentially, I had to comment out the PortGroup muniversal 1.0 line
in the Portfile to get a working universal library for pango.

-Sudish

On Mon, Jun 21, 2010 at 5:09 AM, Giuseppe Luigi Punzi
glpu...@lordzealon.com wrote:
 I died in more dependencies. One, ige-mac-integration. To avoid possible 
 problems I uninstall all ports last night to reinstall full gtk2 with quartz.

 For now, i'm solving all of this and I hope to get it working this night.

 Sudish Joseph sud...@gmail.com wrote:

Antoine Latter aslat...@gmail.com writes:
 On Sun, Jun 20, 2010 at 12:53 PM, Giuseppe Luigi Punzi Ruiz
 glpu...@lordzealon.com wrote:
 Hi again,

 Yes, you are right, but now, cabal install leksah I get:


[...]

 Undefined symbols:
  _iconv_close, referenced from:
      _hs_iconv_close in libHSbase-4.2.0.0.a(iconv.o)
  _iconv_open, referenced from:
      _hs_iconv_open in libHSbase-4.2.0.0.a(iconv.o)
  _iconv, referenced from:
      _hs_iconv in libHSbase-4.2.0.0.a(iconv.o)
 ld: symbol(s) not found

 This one is a bummer, and I see it all the time when I try to build a
 package linked against macports.

This is caused by the two libiconv's in the system being
ABI-incompatible, sadly.  The ghc pkg available for download from
haskell.org is linked against the system /usr/lib/libiconv.dynlib, which
has iconv_open() as a function.  Macports has GNU libiconv which
#defines iconv_open to libiconv_open() in /opt/local/include/iconv.h.

This then blows up as above when linking against other libraries in
macports - the linker pulls in GNU libiconv which lacks the symbols
needed as you see above.

One workaround is to link GHC itself against the macports version of
libiconv (and libgmp) and have cabal-install link all subsequent
libraries against macports.  I did just that this weekend and now have a
working threadscope using the Quartz backend for gtk2, which is very
nice (no need to run the X server).

Recipe for reproducing this build is included below (and I can also
provide the resulting ghc-6.12.3 pkg file if needed).

Another possible option is to use Homebrew to install gtk2 and other
dependencies.  Homebrew prefers to use the system-provided libraries and
will not pull in GNU libiconv, so this should work with the existing GHC
pkg in theory.  I didn't pursue this since the homebrew 'gtk+' package
didn't seem to have the option to use Quartz instead of X11 as its
backend.

Steps for linking the ghc runtime against macports:

-  Specify EXTRA_CABAL_CONFIGURE_FLAGS in mk/build.mk as mentioned at
   the bottom of http://www.haskell.org/ghc/download_ghc_6_12_3.html

   EXTRA_CABAL_CONFIGURE_FLAGS = --extra-include-dirs=/opt/local/include \
                                 --extra-lib-dirs=/opt/local/lib

-  Use the --with-iconv-* and --with-gmp-* flags when configuring ghc.

   ./configure --with-iconv-includes=/opt/local/include \
               --with-iconv-libraries=/opt/local/lib \
               --with-gmp-includes=/opt/local/include \
               --with-gmp-libraries=/opt/local/lib

-  This produces a GHC runtime and libraries linked against macports:

   % otool -L ghc
   ghc:
       /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, 
 current version 5.0.0)
       /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
 version 125.2.0)
       /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
 version 8.0.0)
       /opt/local/lib/libgmp.10.dylib (compatibility version 11.0.0, current 
 version 11.1.0)

   % nm HSbase-4.2.0.2.o | fgrep iconv
   001ff7f0 T _hs_iconv
   001ff7e0 T _hs_iconv_close
   001ff800 T _hs_iconv_open
            U _libiconv
            U _libiconv_close
            U _libiconv_open

   ghc and included libraries use the macports libiconv, so linking
   against other libraries in macports (gtk2!) will work.

-  Have cabal-install use macports as well for packages it installs by
   editing ~/.cabal/config and setting:

   extra-include-dirs: /opt/local/include
   extra-lib-dirs: /opt/local/lib

-  This gives, for e.g., threadscope linked against macports:

   % otool -L ~/.cabal/bin/threadscope | egrep '(gtk|iconv)'
       /opt/local/lib/libgtk-quartz-2.0.0.dylib (compatibility version 
 2001.0.0, current version 2001.1.0)
       /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
 version 8.0.0)

-  Note that since the ghc runtime is still in 32-bit i386 mode, we
   need universal versions of most libraries in macports.  Recent
   versions of macports (1.9 for sure, maybe 1.8) make it simple to
   switch from an x86_64 library to a universal one:

   % port install gtk2 +universal

   This will 

Re: [Haskell-cafe] HaskellWiki and Wikipedia

2010-06-21 Thread Ketil Malde
Roman Beslik ber...@ukr.net writes:

 I do not agree. They are not confused by other languages, they treat
 all languages as born equal. 

Are you saying this is a good thing?

 creating our separate source
 of knowledge leads to isolationism and narrow-minded vision. 

But also to a consistent, and actually *useful* resource.  I'm all for
having an open mind, but not so open that one's brain falls out.

 Maybe Wikipedia articles are bad because they are provided by
 community — then HaskellWiki will suffer likewise. :(

I don't think WP articles are bad because they are provided by a
community, but because they are provided by multiple communities, using
the terms in incompatible ways.

E.g the article on generic programming mainly talks about parametric
polymorphism.  The article on type systems starts off with some
definitions by Cardelli, but goes on to discuss so-called dynamic type
systems, which are an entirely different thing.

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] HaskellWiki and Wikipedia

2010-06-21 Thread Roman Beslik

On 17.06.10 23:44, Ketil Malde wrote:

Roman Beslikber...@ukr.net  writes:
   

I do not agree. They are not confused by other languages, they treat
all languages as born equal.
 

Are you saying this is a good thing?
   

Yes. There is more than Haskell.

E.g the article on generic programming mainly talks about parametric
polymorphism.
Generic programming is a bad term so I do not care if it is used in 
the Haskell sense or in the Wikipedia sense. It should not be used at all.

The article on type systems starts off with some
definitions by Cardelli, but goes on to discuss so-called dynamic type
systems, which are an entirely different thing.
   
Do we read different Wikipedia-s? Wikipedia article Type system 
discussed all kinds of type system, including dependent, linear, 
intersection. Yes, dynamic typing is a type system. Sorry, dear, I 
forgot you did not like it.


--
Best regards,
  Roman Beslik.

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


[Haskell-cafe] design question: decision tree from Programming Collective Intelligence

2010-06-21 Thread Daniel Lyons
Hi,

I'm having a little trouble figuring out precisely how to port the decision 
tree code from the book Programming Collective Intelligence. You can see the 
code here: 
http://code.google.com/p/memothing/source/browse/trunk/PCI/ch7/treepredict.py?r=29

The design issue is that this code depends on dynamic typing pretty heavily. He 
has a table of heterogenous data. Each column has the same type, but that's 
implicit, not explicit. He depends on all of the values supporting ==, which 
he uses to get a list of distinct values from each column. These values are 
used by the divide set function which takes a column and a value as parameters. 
Based on the type of the value, he chooses a different partitioning function; 
for strings, it's just equality again, but for numeric types he uses =. The 
decision tree nodes then collect not just the left and right branches but also 
the column number and value on which the split was performed.

I have thought about this for several days and can't seem to come to a design 
that I like, so I'm wondering how others would approach the problem. I guess 
you could implement it as a list of lists of some data type that is either a 
string or numeric, but this feels a bit like a cop-out. How would you support 
creating a decision tree with different types of data? I imagine possibilities 
using existential quantification, SYB, Data.Data and other stuff, but I don't 
know how to make it work. I wonder if there is an obvious functional design 
hiding in here that doesn't depend on any fancy stuff, but I'm blinded to it by 
having read and understood the Python version of the code.

Anybody have any suggestions? I'd greatly appreciate any help.

Thanks,

— 
Daniel Lyons

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


[Haskell-cafe] Re: Installing Haskell on OSX

2010-06-21 Thread Giuseppe Luigi Punzi
Sorry for my ignorance but..why install with +universal? i didn't use this in 
any port. 

Sudish Joseph sud...@gmail.com wrote:

Hi,

I ran into one problem worth mentioning while recompiling gtk and its
dependencies as universal libraries using macports: the pango port
refused to build with +universal (it fails when trying to merge the
i386  x86_64 libs).  The pango-devel port does work with one small
tweak as described at https://trac.macports.org/ticket/22801.

Essentially, I had to comment out the PortGroup muniversal 1.0 line
in the Portfile to get a working universal library for pango.

-Sudish

On Mon, Jun 21, 2010 at 5:09 AM, Giuseppe Luigi Punzi
glpu...@lordzealon.com wrote:
 I died in more dependencies. One, ige-mac-integration. To avoid possible 
 problems I uninstall all ports last night to reinstall full gtk2 with quartz.

 For now, i'm solving all of this and I hope to get it working this night.

 Sudish Joseph sud...@gmail.com wrote:

Antoine Latter aslat...@gmail.com writes:
 On Sun, Jun 20, 2010 at 12:53 PM, Giuseppe Luigi Punzi Ruiz
 glpu...@lordzealon.com wrote:
 Hi again,

 Yes, you are right, but now, cabal install leksah I get:


[...]

 Undefined symbols:
  _iconv_close, referenced from:
      _hs_iconv_close in libHSbase-4.2.0.0.a(iconv.o)
  _iconv_open, referenced from:
      _hs_iconv_open in libHSbase-4.2.0.0.a(iconv.o)
  _iconv, referenced from:
      _hs_iconv in libHSbase-4.2.0.0.a(iconv.o)
 ld: symbol(s) not found

 This one is a bummer, and I see it all the time when I try to build a
 package linked against macports.

This is caused by the two libiconv's in the system being
ABI-incompatible, sadly.  The ghc pkg available for download from
haskell.org is linked against the system /usr/lib/libiconv.dynlib, which
has iconv_open() as a function.  Macports has GNU libiconv which
#defines iconv_open to libiconv_open() in /opt/local/include/iconv.h.

This then blows up as above when linking against other libraries in
macports - the linker pulls in GNU libiconv which lacks the symbols
needed as you see above.

One workaround is to link GHC itself against the macports version of
libiconv (and libgmp) and have cabal-install link all subsequent
libraries against macports.  I did just that this weekend and now have a
working threadscope using the Quartz backend for gtk2, which is very
nice (no need to run the X server).

Recipe for reproducing this build is included below (and I can also
provide the resulting ghc-6.12.3 pkg file if needed).

Another possible option is to use Homebrew to install gtk2 and other
dependencies.  Homebrew prefers to use the system-provided libraries and
will not pull in GNU libiconv, so this should work with the existing GHC
pkg in theory.  I didn't pursue this since the homebrew 'gtk+' package
didn't seem to have the option to use Quartz instead of X11 as its
backend.

Steps for linking the ghc runtime against macports:

-  Specify EXTRA_CABAL_CONFIGURE_FLAGS in mk/build.mk as mentioned at
   the bottom of http://www.haskell.org/ghc/download_ghc_6_12_3.html

   EXTRA_CABAL_CONFIGURE_FLAGS = --extra-include-dirs=/opt/local/include \
                                 --extra-lib-dirs=/opt/local/lib

-  Use the --with-iconv-* and --with-gmp-* flags when configuring ghc.

   ./configure --with-iconv-includes=/opt/local/include \
               --with-iconv-libraries=/opt/local/lib \
               --with-gmp-includes=/opt/local/include \
               --with-gmp-libraries=/opt/local/lib

-  This produces a GHC runtime and libraries linked against macports:

   % otool -L ghc
   ghc:
       /opt/local/lib/libncurses.5.dylib (compatibility version 5.0.0, 
 current version 5.0.0)
       /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current 
 version 125.2.0)
       /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
 version 8.0.0)
       /opt/local/lib/libgmp.10.dylib (compatibility version 11.0.0, current 
 version 11.1.0)

   % nm HSbase-4.2.0.2.o | fgrep iconv
   001ff7f0 T _hs_iconv
   001ff7e0 T _hs_iconv_close
   001ff800 T _hs_iconv_open
            U _libiconv
            U _libiconv_close
            U _libiconv_open

   ghc and included libraries use the macports libiconv, so linking
   against other libraries in macports (gtk2!) will work.

-  Have cabal-install use macports as well for packages it installs by
   editing ~/.cabal/config and setting:

   extra-include-dirs: /opt/local/include
   extra-lib-dirs: /opt/local/lib

-  This gives, for e.g., threadscope linked against macports:

   % otool -L ~/.cabal/bin/threadscope | egrep '(gtk|iconv)'
       /opt/local/lib/libgtk-quartz-2.0.0.dylib (compatibility version 
 2001.0.0, current version 2001.1.0)
       /opt/local/lib/libiconv.2.dylib (compatibility version 8.0.0, current 
 version 8.0.0)

-  Note that since the ghc runtime is still in 32-bit i386 mode, we
   need universal versions of most libraries in macports.  Recent
   versions of macports (1.9 for sure, 

[Haskell-cafe] Is there good place to post Haskell alorithms/data structures that follow Steven Skiena's book on algorithm design and also Haskell code snippets that follow some of Knuth's books?

2010-06-21 Thread Casey Hawthorne
Is there good place to post Haskell alorithms/data structures that
follow Steven Skiena's book on algorithm design and also Haskell code
snippets that follow some of Knuth's books?

These code snippets don't seem to fit with Hackage.

Is there a Hatorial?

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


Re: [Haskell-cafe] HaskellWiki and Wikipedia

2010-06-21 Thread Ketil Malde
Roman Beslik ber...@ukr.net writes:

 I do not agree. They are not confused by other languages, they treat
 all languages as born equal.

 Are you saying this is a good thing?

 Yes. There is more than Haskell.

Sure.  But when I am programming in Haskell, I am generally most
interested in using terms in that context.  It is an unfortunate fact
that a lot of terms in computer science is used with wildly different
meanings in the different communities.

 Generic programming is a bad term so I do not care if it is used in
 the Haskell sense or in the Wikipedia sense. It should not be used at
 all.

This is arguably correct, but unfortunately it /is/ being used, and it
needs to be defined.

 The article on type systems [..]

 Do we read different Wikipedia-s? Wikipedia article Type system
 discussed all kinds of type system, including dependent, linear,
 intersection. Yes, dynamic typing is a type system. 

Not in the sense of the definition in the first paragraph of the
article ('a tractable syntactic framework').  If you find the article
clean and informative, good for you. In /my/ opinion it's a mess, and
every other sentence is misleading or just flat out wrong.

This is a defect that arises from the way WP is written - you can add
just about anything if you can cite a reliable source claiming it.
Which works out well for the most part, but ends up in chaos when
various sources use the same term for quite different things.

 Sorry, dear, I forgot you did not like it.

Why don't we just agree to disagree without being patronizing and
condescending about it?  And I /like/ dynamic typing, after all, that's
what algebraic data types give you, is it not?

-k
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Installing Haskell on OSX

2010-06-21 Thread Giuseppe Luigi Punzi Ruiz

uhmm..

Now, with all gtk2 rebuilded with +no_x11 and +quartz I get

Linking dist/build/leksah/leksah ...
ld: library not found for -lgtk-x11-2.0
collect2: ld returned 1 exit status
cabal: Error: some packages failed to install:
leksah-0.8.0.6 failed during the building phase. The exception was:
ExitFailure 1

I searched, and it suppose libgtk-x11-2.0 is part of GTK2, but I only  
can found it in darwinports inside xulrunner package, but fails me a  
lot building.


Some idea?

Giuseppe Luigi Punzi Ruiz
Blog: http://www.lordzealon.com
Twitter  Skype  GoogleTalk accounts: glpunzi





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


[Haskell-cafe] Generics and type families

2010-06-21 Thread Louis Wasserman
What is the relationship between -XGenerics and -XTypeFamilies?  Can I
automatically create a data family instance based on its generic
decomposition?
Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] ANN: bitspeak 0.0.1

2010-06-21 Thread Maurí­cio CA

Hi, all,

bitspeak is a small proof of concept application that allows
writing text using only two commands (yes/no, 1/2, top/down etc.).
It is intended to show how people with disabilities similar to
Stephen Hawking's (i.e., good cognitive hability, but very few
movements) can write text.

  http://hackage.haskell.org/package/bitspeak

  http://bitbucket.org/mauricio/bitspeak/wiki/Home

Best,

Maurício

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


Re: [Haskell-cafe] ANN: bitspeak 0.0.1

2010-06-21 Thread Nils Schweinsberg

On 21.06.2010 23:50, Maurí­cio CA wrote:

Hi, all,

bitspeak is a small proof of concept application that allows
writing text using only two commands (yes/no, 1/2, top/down etc.).


Looks cool! Did you forget any dependencies tho? I get the following error:


0:16 nils` cabal update
Downloading the latest package list from hackage.haskell.org
0:17 nils` cabal install bitspeak
Resolving dependencies...
Configuring bitspeak-0.0.1...
Preprocessing executables for bitspeak-0.0.1...
Building bitspeak-0.0.1...

src/Main.hs:7:7:
Could not find module `Corpora':
  Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
bitspeak-0.0.1 failed during the building phase. The exception was:
ExitFailure 1


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


Re: [Haskell-cafe] ANN: bitspeak 0.0.1

2010-06-21 Thread Tom Hawkins
2010/6/21 Maurí­cio CA mauricio.antu...@gmail.com:
 Hi, all,

 bitspeak is a small proof of concept application that allows
 writing text using only two commands (yes/no, 1/2, top/down etc.).
 It is intended to show how people with disabilities similar to
 Stephen Hawking's (i.e., good cognitive hability, but very few
 movements) can write text.

Neat!

Have you looked at Dasher?

http://www.inference.phy.cam.ac.uk/dasher/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Is there good place to post Haskell alorithms/data structures that follow Steven Skiena's book on algorithm design and also Haskell code snippets that follow some of Knuth's books?

2010-06-21 Thread Twan van Laarhoven

Casey Hawthorne wrote:

Is there good place to post Haskell alorithms/data structures that
follow Steven Skiena's book on algorithm design and also Haskell code
snippets that follow some of Knuth's books?

These code snippets don't seem to fit with Hackage.


You could make some pages for them on the Haskell wiki.

If it is structured as a tutorial (which your suggestion of hatorial 
suggests), then you should add it to 
http://haskell.org/haskellwiki/Category:Tutorials




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


Re: [Haskell-cafe] ANN: bitspeak 0.0.1

2010-06-21 Thread John Meacham
On Mon, Jun 21, 2010 at 06:50:41PM -0300, Maurí­cio CA wrote:
 bitspeak is a small proof of concept application that allows
 writing text using only two commands (yes/no, 1/2, top/down etc.).
 It is intended to show how people with disabilities similar to
 Stephen Hawking's (i.e., good cognitive hability, but very few
 movements) can write text.

There is a parallel between data compression algorithms and this sort of
task, expressing a sentence in the minimal number of bits via
compression also minimized the number of yes/no questions that need to
be asked.

In particular, a Huffman coding:
http://en.wikipedia.org/wiki/Huffman_coding
is ideal for this (assuming you just are taking advantage of frequency
analysis). A dynamic Huffman Tree will even adapt as it is being used to
whatever the current language is. Huffman Trees are easy and fun to
implement too.

John

-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: ANN: bitspeak 0.0.1

2010-06-21 Thread Maurí­cio CA

bitspeak is a small proof of concept application that allows
writing text using only two commands (yes/no, 1/2, top/down etc.).


Looks cool! Did you forget any dependencies tho? I get the following error:



Oops... Three modules ended up missing in .cabal file. Just
uploaded 0.0.2 to hackage, it should work.

Thanks!

Maurício

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


[Haskell-cafe] Re: ANN: bitspeak 0.0.1

2010-06-21 Thread Maurí­cio CA

bitspeak is a small proof of concept application that allows
writing text using only two commands (yes/no, 1/2, top/down etc.).


There is a parallel between data compression algorithms and this sort of
task, expressing a sentence in the minimal number of bits via
compression also minimized the number of yes/no questions that need to
be asked.

In particular, a Huffman coding:


Sure, Huffman was actually my first tought. But I couldn't think
of a pratical display for the result of Huffman encoding that
could be easily followed by a human looking at the screen. Since
it's an optimal code, letters would not be grouped in alphabetical
order.

Thinking again, this could be easily accomplished... I could just
list the alphabet and the next bit to be choosed below each letter.
TODO for 0.1.

Thanks!

Maurício

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


Re: [Haskell-cafe] Re: Installing Haskell on OSX

2010-06-21 Thread Hamish Mackenzie
On 22 Jun 2010, at 08:01, Giuseppe Luigi Punzi Ruiz wrote:

 uhmm..
 
 Now, with all gtk2 rebuilded with +no_x11 and +quartz I get
 
 Linking dist/build/leksah/leksah ...
 ld: library not found for -lgtk-x11-2.0
 collect2: ld returned 1 exit status
 cabal: Error: some packages failed to install:
 leksah-0.8.0.6 failed during the building phase. The exception was:
 ExitFailure 1
 
 I searched, and it suppose libgtk-x11-2.0 is part of GTK2, but I only can 
 found it in darwinports inside xulrunner package, but fails me a lot building.
 
 Some idea?

I think something must still have been built against gtk x11.

Did you rebuild all of Gtk2Hs after rebuilding Gtk?
cabal install --reinstall glib
cabal install --reinstall gio
cabal install --reinstall cairo
cabal install --reinstall pango
cabal install --reinstall gtk
cabal install --reinstall gtksourceview

If that does not fix it, you could try this to find the package at fault.
grep gtk-x11 ~/.ghc/i386-darwin-6.12.1/package.conf.d/*

I am interested to see how you get on with MacPorts.  I have not tried it 
myself in a while.  I built the current Leksah OS X binary with jhbuild...
http://sourceforge.net/apps/trac/gtk-osx/wiki/Build

I am sorry that the current binary is not compatible with OS X 10.5.  I will 
try to use OS X 10.5 to build the next release to make sure it is compatible.

Once you have Leksah working you will probably need to update the keymap file 
(~/.cabal/share/leksah-0.8.0.6/data/keymap.lkshk) if you want Command-C, V and 
X to work.  Just uncomment the three lines already in there...
ctrlx -  EditCut
ctrlc -  EditCopy
ctrlv -  EditPaste
You will probably find it beeps each time you use them.  I have a nice fix for 
that but I think it requires a newer version of ige-mac-integration than the 
one in MacPorts.

Good Luck,
Hamish___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Functional programming techniques in small projects

2010-06-21 Thread Nick Rudnick

Hi Markus,

I am afraid your questions are formulated quite narrowly so that people 
you might like to reach might not feel addressed -- so it might be 
helpful to ask yourself how your subject might look in the perspective 
of an average Haskeller, if a such dies exist at all.


At first, please explain what you understand as post mass production 
and how you expect this to be in a relationship with Haskell.


Then, agile software development is used at projects of various sizes -- 
but I guess you want to use this term to emphasize *small* projects -- 
inhowfar do you actually require such to follow agile specifications, 
how about small and one-man-projects which do not follow agile at all?


You are speaking about »student-driven software development«... it might 
be hard for some people to imagine what you mean by this and -- again -- 
inhowfar this relates to Haskell.


Could you please be a little more explicit?


All the best,

   Nick



Markus Dönges wrote:

Hello Community,

I am a student from the University of Duisburg-Essen, Germany, and at 
the moment I am writing my bachelor thesis about Post-Mass-Prodcution 
Softwaresupply/ -development in case of an University administration. 
This approach deals with student-driven software development in which 
functional programming techniques (ie, Haskell) and agile development 
approaches matter.


I am looking for opinions and statements on how small (agile) software 
development projects may benefit from functional programming 
techniques (perhaps in contrast to imperative programming techniques).


Since I am at the very start, I would appreciate further literature 
advices. In addition, does anybody know particular people who are 
familiar with this topic?


Any answer is appreciated :-)

Regards, Markus
___
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] Ph.D. positions on HW acceleration of Haskell

2010-06-21 Thread Rami Mukhtar
=
Vacancies for Ph.D. positions at NICTA with the University of Sydney, Australia
=

Background
~~
NICTA has established a project with a goal of developing technology to map 
high level descriptions of computer vision algorithms to heterogeneous parallel 
hardware architectures. NICTA scholarships are available at the University of 
Sydney for outstanding students in the areas listed below. For further 
information, please contact either:
Dr Rami Mukhtar (rami.mukhtar _AT_ nicta.com.au) or
Dr Philip Leong (philip.leong _AT_ sydney.edu.au).

Further information concerning these scholarships is available from:
http://www.nicta.com.au/education/scholarships/sydney_research_lab/scholarship_opportunities_at_the_university_of_sydney


Reconfigurable Computing Architectures for Acceleration of Functional Languages
--
This project would provide a candidate with the opportunity to develop new 
reconfigurable computing hardware architectures that are well suited for 
accelerating computations on collections of data.  The work would be driven by 
recent advances on computations of collections made in the functional language 
community.  The outcomes of this research would be to develop new hardware 
accelerator architectures, supporting tools chains, and undertake performance 
analysis.  The candidate would be part of a larger team working to develop a 
technology for mapping computer vision algorithms to heterogeneous parallel 
hardware architectures.

Hardware Acceleration of Functional Languages
-
This project would provide a candidate with the opportunity to develop new 
methods for mapping functional languages to implementations that target 
hardware accelerators, including FPGAs and other reconfigurable computing 
architectures.  The outcomes of this research would be to develop algorithms, 
methodologies and related software frameworks that make this possible.  The 
candidate would be part of a larger team working to develop a technology for 
mapping computer vision algorithms to heterogeneous parallel hardware 
architectures.


The information in this e-mail may be confidential and subject to legal 
professional privilege and/or copyright. National ICT Australia Limited accepts 
no liability for any damage caused by this email or its attachments.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe