hs2ps: Translate Haskell types to PureScript

[ library, mit, purescript ] [ Propose Tags ]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.1.0, 0.1.2.0, 0.1.2.1, 0.1.3.0, 0.1.4.0
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), template-haskell (>=2.14.0.0 && <3) [details]
License MIT
Author William Rusnack
Maintainer williamrusnack@gmail.com
Category PureScript
Home page https://bitbucket.org/william_rusnack/hs2ps
Bug tracker https://bitbucket.org/william_rusnack/hs2ps/issues
Uploaded by WilliamRusnack at 2020-02-14T21:21:28Z
Distributions
Downloads 1397 total (19 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2020-02-14 [all 1 reports]

Readme for hs2ps-0.1.4.0

[back to package description]

h2ps-types

Example:

-- translate/Main.hs
module Main where

import Prelude
import Type.HS2PS (renderPSTypes)

main :: IO ()
main = do
  let ts :: String
      ts = $(renderPSTypes
        [ ''Maybe
        , ''Either
        ] )
  let moduleName = "ImportedTypes"
  writeFile ("purs/src/" <> moduleName <> ".purs") $
    "module " <> moduleName <> " where\n\n" <> ts
module ImportedTypes where

data Maybe a = Nothing | Just a
data Either a b = Left a | Right b
# package.yaml
executables:
  translate-types:
    main: Main.hs
    source-dirs: translate
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    dependencies:
    - <package-name>
    - hs2ps
    when:
    - condition: flag(library-only)
      buildable: false