Coder Social home page Coder Social logo

haskell-distributed / rank1dynamic Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 10.0 54 KB

Like Data.Dynamic and Data.Typeable but supporting polymorphic values

Home Page: http://haskell-distributed.github.com

License: BSD 3-Clause "New" or "Revised" License

Haskell 100.00%

rank1dynamic's Introduction

rank1dynamic

travis Release

See http://haskell-distributed.github.com for documentation, user guides, tutorials and assistance.

Getting Help / Raising Issues

Please visit the bug tracker to submit issues. You can contact the [email protected] mailing list for help and comments.

License

This package is made available under a 3-clause BSD-style license.

rank1dynamic's People

Contributors

facundominguez avatar hyperthunk avatar edsko avatar qnikst avatar mboes avatar davidsd avatar markwright avatar nushio3 avatar tristancacqueray avatar utdemir avatar

Stargazers

Tim Kersey avatar  avatar  avatar Yukio Usuzumi avatar Masashi Fujita avatar Anupam <|> अनुपम avatar Daniel Kahlenberg avatar Cheng Shao avatar Andrey Kuznetsov avatar timothy avatar

Watchers

 avatar  avatar  avatar  avatar James Cloos avatar  avatar Duncan Coutts avatar Cloud Haskell avatar Laurent P. René de Cotret avatar  avatar

rank1dynamic's Issues

GHC 8.2.1 Typeable changes cause compilation failure

Data.Typeable has changed significantly with GHC 8.2.1.

src/Data/Rank1Typeable.hs:107:5: error:
    Module ‘Data.Typeable’ does not export ‘mkTyCon3’
    |
107 |   , mkTyCon3
    |     ^^^^^^^^

src/Data/Rank1Typeable.hs:115:1: error:
    Could not find module ‘Data.Typeable.Internal’
    it is a hidden module in the package ‘base-4.10.0.0’
    Use -v to see a list of the files searched for.
    |
115 | import qualified Data.Typeable.Internal as T
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

src/Data/Rank1Typeable.hs:121:5: error:
    Module ‘Data.Typeable’ does not export ‘mkTyConApp’
    |
121 |   , mkTyConApp
    |     ^^^^^^^^^^

It looks like there may be GHC 8.2.1-specific macro blocks needed.

compatibility with ghc-8

src/Data/Rank1Typeable.hs:113:32: error:
    Module ‘Data.Typeable.Internal’ does not export ‘tcList’

src/Data/Rank1Typeable.hs:113:40: error:
    Module ‘Data.Typeable.Internal’ does not export ‘tcFun’

Btw, the "official" bug tracker did not work in my firefox, effectively threw away my filled out issue form because i was not logged in (which is a wild guess; it did not allow me to submit the issue with some "no reporter" error, but there is no "reporter" field on the form) and then refused to let me register with one of my usual mail addresses.

Thanks for providing this package.

New release?

Could we please have a new release? In particular I'd like the fix for #24 released so that I can use a package which depends on distributed-process on nix.

Compile error on GHC 8.0 (base 4.9.0)

Before removing version contraints:

[nix-shell:~/workspace/rank1dynamic]$ runhaskell Setup.hs  configure
Configuring rank1dynamic-0.3.1.0...
Setup.hs: At least the following dependencies are missing:
binary >=0.5 && <0.8, ghc-prim >=0.2 && <0.5

After removing version constraints:

Building rank1dynamic-0.3.1.0...
Preprocessing library rank1dynamic-0.3.1.0...
[1 of 2] Compiling Data.Rank1Typeable ( src/Data/Rank1Typeable.hs, dist/build/Data/Rank1Typeable.o )

src/Data/Rank1Typeable.hs:105:32: error:
    Module ‘Data.Typeable.Internal’ does not export ‘listTc’

src/Data/Rank1Typeable.hs:105:47: error:
    Module ‘Data.Typeable.Internal’ does not export ‘TyCon(TyCon)’
<3>builder for ‘/nix/store/szdn6wp7al4pxcay3lparc41wdsfnhlq-rank1dynamic-0.3.1.0.drv’ failed with exit code 1

My environment:

[nix-shell:~/workspace/rank1dynamic]$ ghc-pkg list
/nix/store/xirfbpcf0yb6b511r93qzm4y83gf9xqw-ghc-8.0.0.20160111/lib/ghc-8.0.0.20160111/package.conf.d
    Cabal-1.23.0.0
    HUnit-1.3.1.0
    ansi-terminal-0.6.2.3
    ansi-wl-pprint-0.6.7.3
    array-0.5.1.0
    base-4.9.0.0
    binary-0.8.0.0
    bytestring-0.10.7.0
    containers-0.5.7.1
    deepseq-1.4.2.0
    directory-1.2.5.0
    extensible-exceptions-0.1.1.4
    filepath-1.4.1.0
    ghc-8.0.0.20160111
    ghc-boot-8.0.0.20160111
    ghc-prim-0.5.0.0
    ghci-8.0.0.20160111
    haskeline-0.7.2.2
    hoopl-3.10.2.1
    hostname-1.0
    hpc-0.6.0.3
    integer-gmp-1.0.0.1
    mtl-2.2.1
    old-locale-1.0.0.7
    pretty-1.1.3.2
    process-1.4.1.0
    random-1.1
    regex-base-0.93.2
    regex-posix-0.95.2
    rts-1.0
    template-haskell-2.11.0.0
    terminfo-0.4.0.2
    test-framework-0.8.1.1
    test-framework-hunit-0.3.0.2
    text-1.2.2.0
    time-1.6
    transformers-0.5.0.0
    unix-2.7.1.1
    xhtml-3000.2.1
    xml-1.3.14

[nix-shell:~/workspace/rank1dynamic]$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.0.0.20160111

Higher-kinded type variables?

I find myself wanting to be able to Typeable quantify over higher-kinded variables, like * -> * or Constraint. This problem comes in two parts: one of them I've thought a lot about and I'm pretty sure I've cracked, and one of them I haven't been able to swing at successfully.

{-# LANGUAGE PolyKinds, DataKinds, EmptyDataDecls, MultiParamTypeClasses, UndecidableInstances, UndecidableSuperclasses #-}
import GHC.TypeLits (Nat)
import qualified GHC.Exts as E (Any)

There's two different approaches, which depend on what version of GHC you have. The first is the simpler, if you have a newer version.

data family Any :: Nat -> k -- Not exported
type family ANY :: Nat -> k where -- Exported
  ANY = Any

Unlike the type family Any from GHC.Exts, the data family here is Typeable.

The other works if you have an older version which can't declare data families ending in anything other than *.

data AnyT0 (n :: Nat) -- None of these datatypes are exported.
data AnyT1 (n :: Nat) (a :: k)
data AnyT2 (n :: Nat) (a :: ka) (b :: kb)
-- And so on.
class E.Any => AnyC0 (n :: Nat) -- And neither are these.
class E.Any => AnyC1 (n :: Nat) (a :: k)
class E.Any => AnyC2 (n :: Nat) (a :: ka) (b :: kb)
type family ANY :: Nat -> k where -- This is, though.
  ANY = AnyT0
  ANY = AnyT1
  ANY = AnyT2
  ANY = AnyC0
  ANY = AnyC1
  ANY = AnyC2
  -- And so on.

This is also more convenient because you use GHC-provided Nats rather than bespoke Peano nats.

The problem I'm having, and the reason this is an issue rather than a pull request, is I don't know how to do inference and unification on these types. I suspect you'd need something similar to GHC's code for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.