Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mdgriffith committed May 28, 2024
1 parent bfc04c7 commit 9799695
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 22 deletions.
22 changes: 4 additions & 18 deletions src/Internal/Arg.elm
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,9 @@ unit =
let
annotation =
Ok (Compiler.inference Annotation.Unit)

imports =
[]
in
{ details =
{ imports = imports
{ imports = []
, pattern = Compiler.nodify Pattern.UnitPattern
, annotation = annotation
}
Expand All @@ -104,7 +101,7 @@ unit =
\_ ->
{ expression = Exp.UnitExpr
, annotation = Ok (Compiler.inference Annotation.Unit)
, imports = imports
, imports = []
}
}
)
Expand Down Expand Up @@ -526,7 +523,7 @@ customType name toType =
)
, annotation = annotation
}
, index = Index.next index
, index = Index.dive index
, value =
toType
}
Expand Down Expand Up @@ -598,17 +595,6 @@ item (Arg itemArg) (Arg arg) =
Result.map
(\ann ->
{ type_ =
-- case ann.type_ of
-- Annotation.Record fields ->
-- Annotation.Record
-- (fields
-- ++ [ Compiler.nodify
-- ( Compiler.nodify name
-- , Compiler.nodify fieldType
-- )
-- ]
-- )
-- _ ->
ann.type_
, inferences = ann.inferences
, aliases = ann.aliases
Expand All @@ -633,7 +619,7 @@ item (Arg itemArg) (Arg arg) =
details.pattern
, annotation = newAnnotation
}
, index = Index.next index
, index = Index.next itemDetails.index
, value =
toSequence.value itemDetails.value
}
Expand Down
8 changes: 4 additions & 4 deletions tests/TypeChecking.elm
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ myMap =
(Type.namedWith [] "Optional" [ Type.var "a" ])
[ Elm.Case.branch
(Arg.customType "Present" identity
|> Arg.item (Arg.var "present")
|> Arg.item (Arg.var "a")
)
(\a ->
present []
Expand All @@ -248,9 +248,9 @@ present optionalModuleName a =
, name = "Present"
, annotation =
Just
(Type.function [ Type.var "a2" ] (Type.namedWith optionalModuleName "Optional" [ Type.var "a2" ]))

-- Nothing
(Type.function [ Type.var "a2" ]
(Type.namedWith optionalModuleName "Optional" [ Type.var "a2" ])
)
}
)
[ a ]
Expand Down

0 comments on commit 9799695

Please sign in to comment.