packages feed

purescript-0.15.15: tests/purs/passing/Newtype.purs

module Main where

import Prelude hiding (apply)
import Effect
import Effect.Console

newtype Thing = Thing String

instance showThing :: Show Thing where
  show (Thing x) = "Thing " <> show x

newtype Box a = Box a

instance showBox :: (Show a) => Show (Box a) where
  show (Box x) = "Box " <> show x

apply f x = f x

main = do
  logShow $ Thing "hello"
  logShow $ Box 42.0
  logShow $ apply Box 9000.0
  log "Done"