Skip to content

Commit

Permalink
fix pattern matching warning in tableSchema tomjaguarpaw#37
Browse files Browse the repository at this point in the history
  • Loading branch information
ryskajakub committed Feb 10, 2017
1 parent b1ca1bd commit 08e4dc2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/Opaleye/Internal/Schema.hs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ data TableSchema = TableSchema String [UntypedColumn]

newtype UntypedColumn = UntypedColumn { unUntypedColumn :: forall a. TM.TableColumn a }

discardSchema :: IT.Table a b -> IT.Table a b
discardSchema (IT.TableWithSchema _ s p) = IT.Table s p
discardSchema a = a
discardSchema :: IT.Table a b -> (String, IT.TableProperties a b)
discardSchema (IT.TableWithSchema _ s p) = (s, p)
discardSchema (IT.Table s p) = (s, p)

tableSchema :: forall read write.
(D.Default SchemaMaker read write) =>
IT.Table write read -> TableSchema
tableSchema (discardSchema -> IT.Table tableName (IT.TableProperties _ (View tableColumns))) =
tableSchema (discardSchema -> (tableName, (IT.TableProperties _ (View tableColumns)))) =
TableSchema tableName columns
where
s :: SchemaMaker read write
Expand All @@ -66,7 +66,6 @@ instance D.Default SchemaMaker (TM.TableColumn a) (TM.TableColumn a) where
instance D.Default SchemaMaker (TM.TableColumn a) (Maybe (Column a)) where
def = columnSchemaMaker


newtype SchemaMaker read dummy =
SchemaMaker (PM.PackMap UntypedColumn () read ())

Expand Down

0 comments on commit 08e4dc2

Please sign in to comment.