Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export type variables T4 through T10 #42

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/Data/Aeson/TypeScript/TH.hs
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,15 @@
, T1(..)
, T2(..)
, T3(..)
, T4(..)
, T5(..)
, T6(..)
, T7(..)
, T8(..)
, T9(..)
, T10(..)

, module Data.Aeson.TypeScript.Instances

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.3

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.6.3

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.7

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.0.2

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 8.10.7

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.4.7

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.6.3

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.4.7

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 8.10.7

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.2.8

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing

Check warning on line 148 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.0.2

The export item ‘module Data.Aeson.TypeScript.Instances’ exports nothing
) where

import Control.Monad
Expand Down Expand Up @@ -281,7 +288,7 @@

#if MIN_VERSION_aeson(0,10,0)
| unwrapUnaryRecords options && (isSingleRecordConstructor ci) -> do
let [typ] = constructorFields ci

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.3

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.6.3

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.7

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.4.7

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.6.3

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.4.7

Pattern match(es) are non-exhaustive

Check warning on line 291 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.2.8

Pattern match(es) are non-exhaustive
stringExp <- lift $ case typ of
(AppT (ConT name) t) | name == ''Maybe && not (omitNothingFields options) -> [|$(getTypeAsStringExp t) <> " | null"|]
_ -> getTypeAsStringExp typ
Expand Down Expand Up @@ -314,7 +321,7 @@
getTSFields :: WriterT [ExtraDeclOrGenericInfo] Q [Exp]
getTSFields = forM (namesAndTypes options genericVariables ci) $ \(name, nameString, typ) -> do
(fieldTyp, optAsBool) <- lift $ case typ of
(AppT (ConT name) t) | name == ''Maybe && not (omitNothingFields options) ->

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.6.3

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.6.3

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 8.10.7

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.2.8

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.2.8

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.4.7

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / ubuntu-latest / ghc 9.0.2

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.0.2

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 8.10.7

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / stack / ghc 9.4.7

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.6.3

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.4.7

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 8.10.7

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.2.8

This binding for ‘name’ shadows the existing binding

Check warning on line 324 in src/Data/Aeson/TypeScript/TH.hs

View workflow job for this annotation

GitHub Actions / macOS-latest / ghc 9.0.2

This binding for ‘name’ shadows the existing binding
( , ) <$> [|$(getTypeAsStringExp t) <> " | null"|] <*> getOptionalAsBoolExp t
_ -> ( , ) <$> getTypeAsStringExp typ <*> getOptionalAsBoolExp typ

Expand Down
Loading