@hackage hs2ps0.1.4.0

Translate Haskell types to PureScript

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