Skip to content

Help with help #19

Description

@yaitskov

Hi,

There is no doc or test with generics.

data SumOfConst
  = SumOfConstA
  | SumOfConstB
derive instance eqActivationFun :: Eq SumOfConst
derive instance genericActivationFun :: Generic SumOfConst _
instance showActivationFun :: Show SumOfConst where
  show u = genericShow u

instance EncodeAeson SumOfConst where
  encodeAeson x = gEncodeAeson x (Proxy :: Proxy _)

gEncodeAeson returns Object a. I could get a via Foreign.Object.values but it returns an array which could be empty. So to avoid partial function some empty Aeson should be returned if array is empty. It doesn't look like correct way of using the library.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions