Sunday, March 30, 2014

p5hs

Copperbox revision 3116.

I've added the initial work on a pretty print.

Although I've been wanting to get back up to (nearly) "a commit a day", the Bradford Film Festival takes priority for the next week...

pretty-expr-hpj

Copperbox revision 3115.

I've added a module for printing Java expressions (needed by P5Hs).

Saturday, March 29, 2014

p5hs

Copperbox revision 3114.

I'm looking at Processing as a target for a Sunroof style compiler. A primary interest in the jni-bridge was binding to Processing-Java but maybe generating Processing code is a viable alternative (less general of course, but potentially easier and more fun).

Getting the "Generative Design" book (Bohnacker et al.) has really made me envious of Processing's "quick path to doing stuff".

Tuesday, March 25, 2014

lambola

Copperbox revision 3113.

Some work on FFI, though I've hit a problem where I can only see GetVersion inside the JNINativeInterface_ struct (in the header jni.h) and none of the other functions. I have a feeling this might scupper my plans until I set up a Linux machine to work on (developing bindings on Windows is far from fun).


Monday, March 24, 2014

lambola

Copperbox revision 3112.

I've started work writing the foreign function stubs.

Although this work is mechanical I'm expecting there will be quite a lot of mistakes / bugs - it's a long time (5 years) since I wrote a FFI binding and that was to OpenVG which was quite "stereotypical" and I could crib a lot from the OpenGL binding. Additionally my C skills were definitely sharper at the time, I haven't really used C (or thought about it much) since then.

Sunday, March 23, 2014

Invoking the JVM via JNI on Windows with MSYS

It took me quite a few hours to get the embedding example (Chapter 7 of the JNI Programmer's Guide) to work with MinGW/MSYS.

Firstly, here's the code for invoke.c, stripped of the JDK 1.1 stuff:


/* invoke.c */

#include <stdio.h>
#include <jni.h>

#define PATH_SEPARATOR ';'
#define USER_CLASSPATH "."

int main(void) {
  JNIEnv *env;
  JavaVM *jvm;
  jint res;
  jclass class;
  jmethodID mid;
  jstring str;
  jclass stringClass;
  JavaVMInitArgs vm_args;
  JavaVMOption options[1];
  options[0].optionString = 
    "-Djava.class.path=" USER_CLASSPATH;
  vm_args.version = 0x00010002;
  vm_args.options = options;
  vm_args.nOptions = 1;
  vm_args.ignoreUnrecognized = JNI_TRUE;
  /* Create the Java VM */
  res = JNI_CreateJavaVM(&jvm, (void**)&env, &vm_args);


  printf("Bye.\n");

destroy:
  if ((*env)->ExceptionOccurred(env)) {
    (*env)->ExceptionDescribe(env);
  }
  (*jvm)->DestroyJavaVM(jvm);
  return 0;
}

Because the jvm.dll is name mangled you need to link to the type library jvm.lib instead (this is the bit that took me a long time to find out from web searches). So this is the command I used to compile with gcc - note I have my jdk in a folder [C:\programs] so the path doesn't have spaces:
$ gcc -D_JNI_IMPLEMENTATION -I/c/programs/java/jdk1.7.0_51/include -I/c/programs/java/jdk1.7.0_51/include/win32 invoke.c -L/c/programs/java/jdk1.7.0_51/lib -ljvm -o invoke.exe
To run I had to add the path to the "client vm" in my Bash path:
$ PATH=$PATH:/c/programs/java/jdk1.7.0_51/jre/bin/client
$ export PATH
Finally I could just run
$ ./invoke.exe

lambola

Copperbox revision 3111.

I've started work on a JNI foreign function interface. I'm aware that there are already several of these for Haskell, but my feeling is that to understand how Haskell-to-Java-via-C works I'll have to implement my own.


Monday, March 17, 2014

lambola

Copperbox revision 3110.

I've made a new prototype for name rewriting.

Name rewriting is split into three phases - tokenizing, rewriting words and recombining. This strategy is not so general, but it does seem to capture the uses cases I have in mind for rewriting variable names to meet language conventions (i.e. C, IDL and Java to Haskell and vice versa). The prototype will need some polish - particularly I need to decide whether to support typed tokens (words) or just Strings. "Just Strings" will have a simpler API if I can get by without more types.

Monday, March 10, 2014

lambola

Copperbox revision 3109.

Some minor dabbling with the rewriting / name mangling code. I'm wondering whether to crib the pattern from QuickCheck where the monadic implementation of the code is de-emphasized in the public API.

Sunday, March 9, 2014

lambola

Copperbox revision 3108.

Work on parser combinators for name mangling. The combinators are based on the usual parser combinators but they rewrite input as they consume it; the run function collects the rewritten trace.


Saturday, March 8, 2014

lambola

Copperbox revision 3107.

I've changed the (initial) translation code to use Template Haskell rather than build Haskell-src-exts abstract syntax. The improvement is evident - I don't know why I didn't think to use Template Haskell in the first place.

I've also started to look at name-wrangling (which seems a more purposeful nomination than name-mangling), it looks like I'll need something sort of combinator library for this.

Thursday, March 6, 2014

lambola

Copperbox revision 3106.

I've fixed all the type errors with the Happy parser so it now compiles. This revealed some "proper" errors in the Parsec parser which are now fixed.

lambola

Copperbox revision 3105.

I've implemented an Alex lexer so now there is enough code to import the Happy parser - which currently has some type errors. I expect there are "proper" errors in the parser (errors in the implementation) to find once it compiles.

Wednesday, March 5, 2014

lambola

Copperbox revision 3104.

I've fleshed out all the productions of the Happy parser, but Happy tells me it has 4 unused rules so some productions must be incomplete. There will be more bugs - I haven't written a lexer yet so can't even type check the generated code.

Tuesday, March 4, 2014

lambola

Copperbox revision 3103.

More work on the Happy parser. It would be nice if Happy support EBNF operators...

Monday, March 3, 2014

lambola

Copperbox revision 3102.

I've moved the IDL code (parser, syntax, pretty printer) into the Lambola namespace, if I think Lambola (eventually) merits a release I don't think the IDL code will ever be canonical enough to merit the Language.IDL namespace.

Also, I've started work on a Happy parser. This should be more robust than the current Parsec parser as the IDL grammar specification is already in LR form. Ideally I would have carried on with yesterday's work on IDL-to-Haskell translation, but I'm not sure of the status of libraries for Haskell quasiquoting on Hackage. Quasiquoting will need some investigation and I was concerned it might have interfered with my intention for "a commit a day".

Sunday, March 2, 2014

lambola

Copperbox revision 3101.

Minor fixes and initial work on translating IDL definitions to Haskell.

It looks like using a quasi-quoter is going to be essential, then I should be able to achieve a translation quite close to the original H/Direct paper. So far I've just used Haskell-src-exts which is rather cumbersome.

Side issue - the "patch" I posted yesterday for H/Direct gets the H/Direct generator to compile but ignores the runtime library. Getting the runtime library working looks like it would be difficult, as it calls primitives that are seemingly unknown to GHC.

Saturday, March 1, 2014

H/Direct patch

Below is a diff to get Don Stewart's package of H/Direct on Hackage to compile with the latest Platform (2013.2.0.0):
diff --recursive hdirect//hdirect.cabal /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/hdirect.cabal
59,62c59,60
<     build-depends:      base >= 2 && < 5,
<                         old-locale >= 1  && <= 1.1,
<                         old-time >= 1.1 && <= 1.2,
<                         process >= 1.0 && <= 1.2,
---
>     build-depends:      haskell98,
>                         base >= 2 && < 5,
69,72c67,68
<     build-depends:      base >= 2 && < 5,
<                         old-locale >= 1  && <= 1.1,
<                         old-time >= 1.0 && <= 1.2,
<                         process >= 1.0 && <= 1.2,
---
>     build-depends:      haskell98,
>                         base >= 2 && < 5,
Only in hdirect/: hdirect.cabal~
diff --recursive hdirect//src/AbsHUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/AbsHUtils.lhs
199,201c199,201
< import Data.Maybe   ( fromMaybe, isJust )
< import Data.Char    ( isLower )
< import Data.List    ( mapAccumL, intersperse )
---
> import Maybe   ( fromMaybe, isJust )
> import Char    ( isLower )
> import List    ( mapAccumL, intersperse )
diff --recursive hdirect//src/Attribute.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Attribute.lhs
17c17
< import Data.List  ( find )
---
> import List  ( find )
19c19
< import Data.Maybe ( mapMaybe )
---
> import Maybe ( mapMaybe )
diff --recursive hdirect//src/Bag.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Bag.lhs
19c19
< import Data.List(partition)
---
> import List(partition)
diff --recursive hdirect//src/BasicTypes.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/BasicTypes.lhs
54c54
< import Data.Maybe ( fromMaybe )
---
> import Maybe ( fromMaybe )
57c57
< import Data.Int
---
> import Int
diff --recursive hdirect//src/CStubGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CStubGen.lhs
18,19c18,19
< import Data.List  ( nub )
< import Data.Maybe ( isJust )
---
> import List  ( nub )
> import Maybe ( isJust )
diff --recursive hdirect//src/CgMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CgMonad.lhs
86c86
< import Data.Maybe   ( fromMaybe )
---
> import Maybe   ( fromMaybe )
diff --recursive hdirect//src/CodeGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CodeGen.lhs
57c57
< import Data.List  ( partition, intersperse, isPrefixOf )
---
> import List  ( partition, intersperse, isPrefixOf )
61,62c61,62
< import Data.Maybe ( mapMaybe, isJust )
< import Control.Monad ( when )
---
> import Maybe ( mapMaybe, isJust )
> import Monad ( when )
diff --recursive hdirect//src/CoreIDL.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CoreIDL.lhs
16c16
< import Data.Int ( Int32 )
---
> import Int ( Int32 )
diff --recursive hdirect//src/CoreUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/CoreUtils.lhs
211,213c211,213
< import Data.Maybe  ( mapMaybe, fromMaybe, mapMaybe, isJust )
< import Data.List   ( partition, find, nub, mapAccumL )
< import Data.Char   ( toLower, toUpper, isLower, isUpper, isAlpha, isDigit )
---
> import Maybe  ( mapMaybe, fromMaybe, mapMaybe, isJust )
> import List   ( partition )
> import Char   ( toLower, toUpper, isLower, isUpper, isAlpha, isDigit )
217,219c217,219
< import Data.Int
< -- import List
< import Data.Bits
---
> import Int
> import List
> import Bits
diff --recursive hdirect//src/DefGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/DefGen.lhs
10c10
< import Data.List
---
> import List
diff --recursive hdirect//src/Desugar.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Desugar.lhs
56,60c56,60
< import Data.Int
< import Control.Monad
< import Data.Maybe    ( isJust, fromJust, fromMaybe )
< import Data.Char ( toLower, isSpace )
< import Data.List ( partition, sort, sortBy, isPrefixOf )
---
> import Int
> import Monad
> import Maybe    ( isJust, fromJust, fromMaybe )
> import Char ( toLower, isSpace )
> import List ( partition, sort, sortBy, isPrefixOf )
diff --recursive hdirect//src/Digraph.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Digraph.lhs
38,40c38,40
< import Data.Maybe
< import Data.Array
< import Data.List ( sortBy, (\\) )
---
> import Maybe
> import Array
> import List ( sortBy, (\\) )
diff --recursive hdirect//src/DsMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/DsMonad.lhs
83,85c83,85
< import System.IO  ( hPutStrLn, stderr )
< import Data.Int ( Int32 )
< import Control.Monad ( when )
---
> import IO  ( hPutStrLn, stderr )
> import Int ( Int32 )
> import Monad ( when )
87c87
< import Data.Maybe ( catMaybes )
---
> import Maybe ( catMaybes )
diff --recursive hdirect//src/FiniteMap.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/FiniteMap.lhs
51c51
< import Data.Maybe( isJust )
---
> import Maybe( isJust )
diff --recursive hdirect//src/GetOpt.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/GetOpt.lhs
74c74
< import Control.Monad
---
> import Monad
diff --recursive hdirect//src/HugsCodeGen.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/HugsCodeGen.lhs
18c18
< import Data.List  ( nub, intersperse )
---
> import List  ( nub, intersperse )
diff --recursive hdirect//src/IDLUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/IDLUtils.lhs
112,114c112,114
< import Data.Int
< import Data.Word    ( Word16 )
< import Data.Bits
---
> import Int
> import Word    ( Word16 )
> import Bits
116,117c116,117
< import Data.List   ( isPrefixOf, find )
< import Data.Char   ( isDigit, isAlpha, isSpace )
---
> import List   ( isPrefixOf, find )
> import Char   ( isDigit, isAlpha, isSpace )
120,121c120,121
< import Data.Maybe
< import Control.Monad
---
> import Maybe
> import Monad
diff --recursive hdirect//src/JavaProxy.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/JavaProxy.lhs
24c24
< import Data.Maybe  ( mapMaybe )
---
> import Maybe  ( mapMaybe )
diff --recursive hdirect//src/Lex.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Lex.lhs
16c16
< import Data.Char
---
> import Char
19c19
< import Data.List ( isPrefixOf )
---
> import List ( isPrefixOf )
diff --recursive hdirect//src/LexM.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/LexM.lhs
57,59c57,59
< import System.IO      ( hPutStrLn, stderr )
< import Control.Monad   ( when )
< import Data.Char    ( toLower )
---
> import IO      ( hPutStrLn, stderr )
> import Monad   ( when )
> import Char    ( toLower )
diff --recursive hdirect//src/Literal.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Literal.lhs
25c25
< import Data.List ( intersperse )
---
> import List ( intersperse )
diff --recursive hdirect//src/Main.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Main.lhs
31,33c31
< import Control.Exception ( catch )
< import System.Time ( getClockTime, toCalendarTime, formatCalendarTime )
< import System.IO  ( hPutStr, hPutStrLn, stderr, stdout, hPutChar,
---
> import IO  ( hPutStr, hPutStrLn, stderr, stdout, hPutChar,
36,38c34,35
< import Control.Monad  ( when )
< import System.Environment ( getProgName )
< import System.Exit ( exitWith, ExitCode(..) )
---
> import Monad  ( when )
> import System (getProgName, exitWith, ExitCode(..) )
41,42c38,39
< -- import Data.Time
< import Data.List  ( partition )
---
> import Time
> import List  ( partition )
44c41
< import System.Locale
---
> import Locale
diff --recursive hdirect//src/MarshallAuto.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallAuto.lhs
34c34
< import Data.Maybe ( isJust )
---
> import Maybe ( isJust )
diff --recursive hdirect//src/MarshallCore.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallCore.lhs
56,57c56,57
< import Data.Maybe
< import Data.List     ( nub )
---
> import Maybe
> import List     ( nub )
diff --recursive hdirect//src/MarshallDep.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallDep.lhs
31,33c31,33
< import Data.List  ( nubBy )
< import Data.Maybe ( mapMaybe, fromMaybe, fromJust, isJust )
< import Control.Monad ( when )
---
> import List  ( nubBy )
> import Maybe ( mapMaybe, fromMaybe, fromJust, isJust )
> import Monad ( when )
diff --recursive hdirect//src/MarshallFun.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallFun.lhs
31c31
< import Data.Maybe
---
> import Maybe
diff --recursive hdirect//src/MarshallJNI.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallJNI.lhs
34,35c34,35
< import Control.Monad ( when )
< import Data.Maybe ( mapMaybe )
---
> import Monad ( when )
> import Maybe ( mapMaybe )
diff --recursive hdirect//src/MarshallMethod.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallMethod.lhs
96,97c96,97
< import Data.Maybe  ( fromMaybe, isJust, fromJust )
< import Control.Monad       ( when, mplus )
---
> import Maybe  ( fromMaybe, isJust, fromJust )
> import Monad       ( when, mplus )
diff --recursive hdirect//src/MarshallServ.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallServ.lhs
47,48c47,48
< import Control.Monad ( when )
< import Data.Maybe
---
> import Monad ( when )
> import Maybe
diff --recursive hdirect//src/MarshallStruct.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallStruct.lhs
40,41c40,41
< import Data.List    ( findIndex, partition )
< import Data.Maybe    ( mapMaybe  )
---
> import List    ( findIndex, partition )
> import Maybe    ( mapMaybe  )
diff --recursive hdirect//src/MarshallType.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallType.lhs
50c50
< import Data.Maybe ( fromMaybe, isJust, fromJust )
---
> import Maybe ( fromMaybe, isJust, fromJust )
diff --recursive hdirect//src/MarshallUnion.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallUnion.lhs
26c26
< import Data.Char       ( ord )
---
> import Char       ( ord )
diff --recursive hdirect//src/MarshallUtils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MarshallUtils.lhs
45c45
< import Data.List  ( intersperse )
---
> import List  ( intersperse )
diff --recursive hdirect//src/MkImport.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/MkImport.lhs
24c24
< import Data.List   ( nub )
---
> import List   ( nub )
diff --recursive hdirect//src/Opts.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Opts.lhs
13,14c13
< import System.Environment ( getArgs )
< -- import System
---
> import System
16,17c15,16
< import System.IO     ( hPutStrLn, stderr )
< import Control.Monad  ( when )
---
> import IO     ( hPutStrLn, stderr )
> import Monad  ( when )
diff --recursive hdirect//src/Parser.hs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Parser.hs
34c34
< import System.IO ( hPutStrLn, stderr )
---
> import IO ( hPutStrLn, stderr )
diff --recursive hdirect//src/Parser.y /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Parser.y
32c32
< import System.IO ( hPutStrLn, stderr )
---
> import IO ( hPutStrLn, stderr )
diff --recursive hdirect//src/PpAbstractH.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpAbstractH.lhs
43c43
< import Data.Char  ( isAlpha )
---
> import Char  ( isAlpha )
diff --recursive hdirect//src/PpCore.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpCore.lhs
20c20
< import Data.List  ( partition )
---
> import List  ( partition )
24,25c24,25
< import Data.Maybe ( fromMaybe )
< import Data.Char  ( isAlphaNum, toUpper )
---
> import Maybe ( fromMaybe )
> import Char  ( isAlphaNum, toUpper )
diff --recursive hdirect//src/PpIDLSyn.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PpIDLSyn.lhs
16c16
< import Data.Maybe
---
> import Maybe
diff --recursive hdirect//src/PreProc.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/PreProc.lhs
1,2d0
< > {-# LANGUAGE ScopedTypeVariables      #-}
< 
20d17
< import Control.Exception ( catch )
22,24c19,20
< import System.CPUTime
< import System.Environment  ( getEnv )
< import System.Process ( system )
---
> import CPUTime
> import System  ( getEnv, system )
26c22
< import Data.List    ( intersperse )
---
> import List    ( intersperse )
28c24
< -- import IO
---
> import IO
30c26
< import Control.Monad
---
> import Monad
48c44
<                (\ (_ :: IOError) -> return "/tmp/")
---
>                (\ _ -> return "/tmp/")
73c69
<                (\(_ :: IOError)-> return ("gcc -E -x c"))
---
>                (\ _ -> return ("gcc -E -x c"))
86c82
<                ( \ (_ :: IOError)-> return "/tmp/")
---
>                ( \ _ -> return "/tmp/")
89c85
<                    ( \ (_ :: IOError)-> return "rm -f")
---
>                    ( \ _ -> return "rm -f")
diff --recursive hdirect//src/Rename.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Rename.lhs
55,58c55,58
< import Data.Maybe  ( isJust, fromMaybe )
< import Data.List      ( isPrefixOf )
< import Control.Monad     ( when, mplus )
< import Data.Char  ( isUpper, toUpper )
---
> import Maybe  ( isJust, fromMaybe )
> import List      ( isPrefixOf )
> import Monad     ( when, mplus )
> import Char  ( isUpper, toUpper )
diff --recursive hdirect//src/RnMonad.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/RnMonad.lhs
63c63
< import Data.Maybe ( isJust )
---
> import Maybe ( isJust )
diff --recursive hdirect//src/Skeleton.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Skeleton.lhs
21c21
< import Data.List ( partition )
---
> import List ( partition )
diff --recursive hdirect//src/TypeInfo.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/TypeInfo.lhs
27c27
< import Data.Maybe
---
> import Maybe
diff --recursive hdirect//src/Utils.lhs /cygdrive/e/ghc/libraries/ghc_7_6_3/hdirect-0.21.0/src/Utils.lhs
1,2d0
< > {-# LANGUAGE ScopedTypeVariables        #-}
< 
55,56c53
< import Data.Char (chr, ord, readLitChar)
< import Control.Exception ( catch )
---
> import Char (chr, ord, readLitChar)
58c55,56
< import Data.Int
---
> import IO
> import Int
60c58
< import System.Directory
---
> import Directory
62,63c60,61
< import Control.Monad ( when )
< import Data.List  ( mapAccumL, isPrefixOf )
---
> import Monad ( when )
> import List  ( mapAccumL, isPrefixOf )
283c281
<             `catch` (\ (_::IOError) -> return False)
---
>             `catch` (\ _ -> return False)

Blog Archive

About Me

My photo
Disambiguating biog as there are a few Stephen Tetley's in the world. I'm neither a cage fighter or yachtsman. I studied Fine Art in the nineties (foundation Bradford 1992, degree Cheltenham 1992 - 95) then Computing part-time at Leeds Met graduating in 2003. I'm the Stephen Tetley on Haskell Cafe and Stackoverflow.