From orlandodarhill at gmail.com Wed Sep 12 14:36:10 2007 From: orlandodarhill at gmail.com (Orlando Hill) Date: Thu, 13 Sep 2007 00:36:10 +1200 Subject: [Liskell-devel] Running Problems Message-ID: <46E7DD3A.5050800@gmail.com> Hi. I really like the idea of Liskell but haven't been able to get it running yet. I've downloaded and compiled the version in darcs. I then did make install. (Was I supposed to? I don't know.) At this point I wasn't sure what to do next. I assume that I use the 'ghc' that was just installed. Doing 'ghc -c -v' on some of your examples gives the error listed at the bottom. It talks about LskPrelude.hi and as far as I can tell, it isn't installed outside the liskell build directory. Hope you can point out where I'm going wrong. Thanks, Orlando. ========================= Glasgow Haskell Compiler, Version 6.6.1, for Haskell 98, compiled by GHC version 6.6.1 Using package config file: /usr/local/lib/ghc-6.6.1/package.conf wired-in package base mapped to base-2.1.1 wired-in package rts mapped to rts-1.0 wired-in package haskell98 mapped to haskell98-1.0 wired-in package LskPrelude mapped to LskPrelude-0.1 wired-in package ghc mapped to ghc-6.6.1 wired-in package template-haskell mapped to template-haskell-2.1 Hsc static flags: -static Created temporary directory: /tmp/ghc4837_0 *** Checking old interface for main:Prolog: *** Parser: *** Renamer/typechecker: Prolog.lsk:11:0: Failed to load interface for `LskPrelude': locations searched: LskPrelude.hi LskPrelude.hi-boot /usr/local/lib/ghc-6.6.1/imports/LskPrelude.hi *** Deleting temp files: Deleting: /tmp/ghc4837_0/ghc4837_0.s Warning: deleting non-existent /tmp/ghc4837_0/ghc4837_0.s *** Deleting temp dirs: Deleting: /tmp/ghc4837_0 From clemens at endorphin.org Fri Sep 14 11:32:35 2007 From: clemens at endorphin.org (Clemens Fruhwirth) Date: Fri, 14 Sep 2007 11:32:35 +0200 Subject: [Liskell-devel] Running Problems In-Reply-To: <46E7DD3A.5050800@gmail.com> References: <46E7DD3A.5050800@gmail.com> Message-ID: <87zlzph9sc.wl%clemens@endorphin.org> At Thu, 13 Sep 2007 00:36:10 +1200, Orlando Hill wrote: > I've downloaded and compiled the version in darcs. I then did make > install. (Was I supposed to? I don't know.) You could also run it inplace. That's what I do most of the time, as I don't want it to replace the system's GHC. Just invoke ghc-topdir/compiler/stage2/ghc-inplace But make install is fine too (now, read below) > At this point I wasn't sure what to do next. I assume that I use the > 'ghc' that was just installed. Correct. > Doing 'ghc -c -v' on some of your examples gives the error listed at the > bottom. It talks about LskPrelude.hi and as far as I can tell, it isn't > installed outside the liskell build directory. > > Hope you can point out where I'm going wrong. My fault, LskPrelude.hi was not properly installed in the imports directory of GHC. Please pull the last changes from the LskPrelude library, either './darcs-get pull -a' at your GHC toplevel, or cd libraries/LskPrelude; darcs pull -a then recompile and reinstall (actually running make install in libraries/LskPrelude should be sufficient too). This time LskPrelude.hi should end up in the proper location. -- Fruhwirth Clemens - http://clemens.endorphin.org From aidenn0 at yahoo.com Tue Sep 18 22:37:44 2007 From: aidenn0 at yahoo.com (Jason Miller) Date: Tue, 18 Sep 2007 13:37:44 -0700 (PDT) Subject: [Liskell-devel] do special form Message-ID: <996372.98229.qm@web52710.mail.re2.yahoo.com> I can't seem to find any equivalent of the liskell "do" special form in liskell. For a trivial example: do c <- getChar putChar c putChar 'a' liskell equivalent is (>> (>>= (getChar) (putChar)) (putChar #\a) ) It would be nice to do something like (do (<- c getChar) (putChar c) (putChar #\a)) It would seem possible to do something like this with a PTT. Is anyone working on something like this before I dive in? -Jason ____________________________________________________________________________________ Need a vacation? Get great deals to amazing places on Yahoo! Travel. http://travel.yahoo.com/ From aidenn0 at yahoo.com Thu Sep 27 18:45:36 2007 From: aidenn0 at yahoo.com (Jason Miller) Date: Thu, 27 Sep 2007 09:45:36 -0700 (PDT) Subject: [Liskell-devel] do special form Message-ID: <166930.32774.qm@web52711.mail.re2.yahoo.com> Well I finally had a chance to run through the Haskell language docs, and it was pretty trivial to write a macro that accomplishes what I was looking for. However, it's not hygienic, and it doesn't print out a good error message when the pattern match fails yet. I'll need to do some more digging to see if I can create an equivalent of gensym to make this work better. (defmacro (do pts) (dohelper pts)) (define (dohelper pts) (case pts (%(e) `(,pts)) ((: (SList ([] (SSym "<-") p e)) stmts) `(let (((ok ,p) ,(dohelper stmts)) ((ok _) (fail "stuff"))) (>>= ,e ok))) ((: e stmts) `(>> ,e ,(dohelper stmts))))) (add-dspr (expression do)) this is 100% ripped out of the Haskell 98 report sec. 3.14 (but converted to s-expressions) I think it does a good job of demonstrating what macros can do. If you want to expose the ugly non-hygenic behavior of this: (define (ok stuff) (words stuff)) (define (testdo2) (do (putStr "x: ") (<- l getLine) (return (ok l)))) That will fail to compile because the call to "ok" will happen in the let binding created by the macro. I come from a CL background, so gensym is the way I think of to get around this. I'll do some more digging to see if there is a way to create something similar. Any comments appreciated. -Jason ____________________________________________________________________________________ Need a vacation? Get great deals to amazing places on Yahoo! Travel. http://travel.yahoo.com/