Roman Cheplyaka | 8 Feb 23:55
Gravatar

Rank 2 types error

Hi,

The following program is accepted by GHC 7 with -XRank2Types:

    class C a where
        f :: a -> a

    newtype R = R (forall a . C a => a)

    instance C R where
        f (R x) = R $ f x

    main = return ()

jhc 0.8 gives the following error:

    [1 of 1] Main             (...............jhci: user error (
    What:    failure
    Why:     Signature too Weak: [] does not imply [Main.C Main.v11]
    Where:   on line 7 in j.hs
    in the explicitly typed Instance@.iMain.f.Main.R (Main.R Main.6_x)
      = Main.R Jhc.Basics.$ Main.f Main.6_x		{- on line 7 -}
    Compilation of module: Main)

Is this difference in behaviour intended, and how can I make something
like that compile?

--

-- 
Roman I. Cheplyaka :: http://ro-che.info/
(Continue reading)

Roman Cheplyaka | 8 Feb 23:33
Gravatar

error messages and outdated packages

Hi John and others,

I guess the following message tries to tell me that (<*) is not a member
of the Applicative class:

[1 of 1] Text.Regex.Applicative.Interface(.......jhci: sigFromClass:
Control.Applicative.Applicative [(Control.Applicative.pure, forall f0 a .
Control.Applicative.Applicative f0 => a -> f0 a),(Control.Applicative.<*>, forall f0 a b .
Control.Applicative.Applicative f0 => f0 (a -> b) -> f0 a -> f0 b)] Control.Applicative.<*

Could it be improved?

Also, I'd like to update the 'applicative' package to match the current
'base', but before I spend time on that I'd like to check if there are
no objections to merging the changes into the jhc repository.

--

-- 
Roman I. Cheplyaka :: http://ro-che.info/
Daniel Gorín | 8 Feb 13:04
Picon
Gravatar

couldn't build jhc-0.8 from the tarball

Hi

I wanted to try jhc 0.8. I followed the instructions here [1], but after
unpacking jhc-0.8.0.tar.gz, configure runs ok but make fails with:

$ make
perl ./utils/op_raw.prl src/RawFiles src/data/ViaGhc.hs
src/data/prelude.m4 src/data/targets.ini rts/rts_constants.h
rts/stableptr.c rts/queue.h src/data/HsFFI.h rts/wsize.h rts/bitarray.h
ChangeLog src/data/shortchange.txt > src/RawFiles.hs
make: *** No rule to make target `src/Options.hs', needed by
`drift_processed/Options.hs'.  Stop.

Any ideas?

Thanks,
Daniel

[1] http://repetae.net/computer/jhc/building.shtml
John Meacham | 8 Feb 05:03
Favicon

ANNOUNCE: jhc-0.8.0

I am happy to announce jhc 0.8.0

There have been A lot of major changes in jhc with this release.

 - http://repetae.net/computer/jhc

- A brand new and sanified library description file format. Now it is a true
  YAML file. The previous quasi-cabal files are supported but deprecated.

- new standard library 'bytestring' :)

- jhc can now embed C code and header files directly into hl libraries. The
  code will automatically be unpacked and linked when needed transparently.
  This allows 'bytestring' to carry around its fpsstring.c low level
  implementaton for instance without having to coordinate the install of C
  headers/code along with the jhc haskell library.

- the library description files now can affect pretty much any aspect of
  compilation, so it is much easier to make a self-contained build or for tools
  like configure/cabal to interface to jhc. They just need to spit out an
  appropriate yaml file rather than care about passing the right options to jhc
  in addition to creating a description file. See the user manual for the set
  of fields that can be set.

- jhc now understands ghc-style LANGUAGE pragmas and -X options and will
  translate them into the appropriate jhc extensions as needed.

- jhc transparently handles '.hsc' files (assuming you have hsc2hs installed).
  It even does the right thing when cross compiliing and will use the target
  architectures types rather than the hosts.
(Continue reading)

John Meacham | 8 Feb 04:55
Favicon

darcs patch: clean up foreignptr implementation some. (and 7 more)

Mon Feb  6 10:11:22 PST 2012  John Meacham <john <at> repetae.net>
  * clean up foreignptr implementation some.

Mon Feb  6 17:57:19 PST 2012  John Meacham <john <at> repetae.net>
  * add Jhc.Prim.Rts to access properties of the RTS

Mon Feb  6 22:32:02 PST 2012  John Meacham <john <at> repetae.net>
  * add support for 'Coerce' grin primitive, add atomic allocs in grin.

Tue Feb  7 02:55:10 PST 2012  John Meacham <john <at> repetae.net>
  * make foreign imports work with unboxed IO types, improve primitive operators.

Tue Feb  7 03:56:05 PST 2012  John Meacham <john <at> repetae.net>
  * clean up handling of raw files, keep source file separate when compiling. include useful header files
when compiling.

Tue Feb  7 17:52:20 PST 2012  John Meacham <john <at> repetae.net>
  * fixes for distribution.

Tue Feb  7 18:00:17 PST 2012  John Meacham <john <at> repetae.net>
  * added 0.8.0 announcment

Tue Feb  7 18:00:26 PST 2012  John Meacham <john <at> repetae.net>
  tagged 0.8.0
_______________________________________________
jhc mailing list
jhc <at> haskell.org
(Continue reading)

John Meacham | 7 Feb 14:07
Favicon

Re: almost to 0.8.0 - feedback welcome

On Tue, Feb 7, 2012 at 4:53 AM, Henning Thielemann
<lemming <at> henning-thielemann.de> wrote:
>> Yeah, I discovered that bug too. Not sure what exactly introduced it but i
>> was
>> messing with the renamer. I temporarily disblede utility-ht until I get a
>> chance to look at it again.
>
> I am innocent.

Yes you are. :)

>> Well, it isn't really base 1.0, it has no relation to the hackage/ghc
>> version
>> other than the unfortunate shared name and the fact they implement similar
>> things which can be confusing. There is no correspondence between the
>> version
>> numbers but it does support many of the interfaces that newer versions of
>> ghcs
>> base has, so you can generally compile cabal projects by simply deleting
>> their
>> build-depends and letting jhc loose on it.
>
>
> For me a package that tracks the various simple additions to Data.List and
> Control.Monad, while omitting more complicated stuff like concurrency, would
> be nice. I would really like to write packages that can be compiled on both
> GHC and JHC without cabal switches.

Yeah, something like that was my goal with 'base' originally, but I don't think
it helped much because it wasn't clear which extensions to the haskell2010
(Continue reading)

John Meacham | 7 Feb 12:47
Favicon

darcs patch: allow extra C code to be bundled within .hl files, inc...

Mon Feb  6 07:30:22 PST 2012  John Meacham <john <at> repetae.net>
  * allow extra C code to be bundled within .hl files, include bytestring in the standard external libraries.
_______________________________________________
jhc mailing list
jhc <at> haskell.org
http://www.haskell.org/mailman/listinfo/jhc
John Meacham | 7 Feb 12:47
Favicon

darcs patch: remove old references to the haskell obj... (and 1 more)

Mon Feb  6 04:24:44 PST 2012  John Meacham <john <at> repetae.net>
  * remove old references to the haskell object directory, made everything cache based. added --purge-cache

Mon Feb  6 06:03:18 PST 2012  John Meacham <john <at> repetae.net>
  * pass -D flags to hsc2hs, add CLong and CULong instances, fill out Foreign.ForeignPtr
_______________________________________________
jhc mailing list
jhc <at> haskell.org
http://www.haskell.org/mailman/listinfo/jhc
John Meacham | 7 Feb 12:46
Favicon

darcs patch: remove a lot of unneeded dependencies. (and 4 more)

Sun Feb  5 22:56:36 PST 2012  John Meacham <john <at> repetae.net>
  * remove a lot of unneeded dependencies.

Mon Feb  6 00:13:57 PST 2012  John Meacham <john <at> repetae.net>
  * move arrays to jhc-prim, remove special IORef specific primitives in favor of length 1 arrays

Mon Feb  6 01:27:30 PST 2012  John Meacham <john <at> repetae.net>
  * include location of 'import' declaration for unknown imports, move Data.Int and Data.Word out of jhc

Mon Feb  6 01:52:09 PST 2012  John Meacham <john <at> repetae.net>
  * remove redundant dependencies from 'base'

Mon Feb  6 03:22:32 PST 2012  John Meacham <john <at> repetae.net>
  * update documentation, move Data.Char to base
_______________________________________________
jhc mailing list
jhc <at> haskell.org
http://www.haskell.org/mailman/listinfo/jhc
John Meacham | 6 Feb 09:17
Favicon

darcs patch: don't require 'error' to be in scope for... (and 2 more)

Sun Feb  5 22:11:51 PST 2012  John Meacham <john <at> repetae.net>
  * don't require 'error' to be in scope for where pattern desugaring, process renaming errors before kind inference

Sun Feb  5 22:13:04 PST 2012  John Meacham <john <at> repetae.net>
  * add script to check for and remove unneeded imports from libraries, remove a bunch from lib/jhc/

Sun Feb  5 22:13:14 PST 2012  John Meacham <john <at> repetae.net>
  * create Jhc.Class.Real to hold more advance numeric classes.
_______________________________________________
jhc mailing list
jhc <at> haskell.org
http://www.haskell.org/mailman/listinfo/jhc
John Meacham | 6 Feb 09:16
Favicon

darcs patch: use quoteName mechanism to pre-rename ce... (and 1 more)

Sun Feb  5 16:57:46 PST 2012  John Meacham <john <at> repetae.net>
  * use quoteName mechanism to pre-rename certain names, fix class instance namespace bug

Sun Feb  5 18:28:10 PST 2012  John Meacham <john <at> repetae.net>
  * seperate --stop parameter from compilation mode
_______________________________________________
jhc mailing list
jhc <at> haskell.org
http://www.haskell.org/mailman/listinfo/jhc

Gmane