Play

Check-in [8dbdb99d0a]
Login
Overview
Comment:Undo bad commit.
Timelines: family | ancestors | descendants | both | stdlib
Files: files | file ages | folders
SHA3-256: 8dbdb99d0a160906645846671c0518179242bd947031fa9d1231dda94db59fd7
User & Date: robin.hansen on 2021-04-16 09:00:36
Other Links: branch diff | manifest | tags
Context
2021-04-16
14:56
Fix bug where generic arguments in quotations didn't renamed properly in the type checking phase, ca... check-in: a64dc94e65 user: robin.hansen tags: stdlib
09:00
Undo bad commit. check-in: 8dbdb99d0a user: robin.hansen tags: stdlib
08:25
Bad commit. check-in: 858d57ef6f user: robin.hansen tags: stdlib
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified src/Play/TypeChecker.elm from [9269e15943] to [b8dcd8121c].

246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273

                        firstType :: _ ->
                            ( Qualifier.TypeMatch SourceLocation.emptyRange firstType [], defaultImpl ) :: initialWhens

        ( inferredWhenTypes, newContext ) =
            whens
                |> List.foldr (inferWhenTypes untypedDef) ( [], context )
                |> Tuple.mapFirst logFold
                |> Tuple.mapFirst normalizeWhenTypes
                |> (\( wts, ctx ) -> simplifyWhenWordTypes wts ctx)
                |> Tuple.mapFirst (List.map2 Tuple.pair whenPatterns >> List.map replaceFirstTypeWithPatternMatch)
                |> Tuple.mapFirst equalizeWhenTypes
                |> Tuple.mapFirst (\whenTypes -> List.map (constrainGenerics untypedDef.metadata.type_) whenTypes)

        logFold a =
            if String.endsWith "fold" untypedDef.name then
                Debug.log "fold" a

            else
                a

        replaceFirstTypeWithPatternMatch ( Qualifier.TypeMatch _ matchType _, typeSignature ) =
            case typeSignature.input of
                ((Type.Generic _) as toReplace) :: _ ->
                    { input = List.map (replaceType toReplace matchType) typeSignature.input
                    , output = List.map (replaceType toReplace matchType) typeSignature.output
                    }








<






<
<
<
<
<
<
<







246
247
248
249
250
251
252

253
254
255
256
257
258







259
260
261
262
263
264
265

                        firstType :: _ ->
                            ( Qualifier.TypeMatch SourceLocation.emptyRange firstType [], defaultImpl ) :: initialWhens

        ( inferredWhenTypes, newContext ) =
            whens
                |> List.foldr (inferWhenTypes untypedDef) ( [], context )

                |> Tuple.mapFirst normalizeWhenTypes
                |> (\( wts, ctx ) -> simplifyWhenWordTypes wts ctx)
                |> Tuple.mapFirst (List.map2 Tuple.pair whenPatterns >> List.map replaceFirstTypeWithPatternMatch)
                |> Tuple.mapFirst equalizeWhenTypes
                |> Tuple.mapFirst (\whenTypes -> List.map (constrainGenerics untypedDef.metadata.type_) whenTypes)








        replaceFirstTypeWithPatternMatch ( Qualifier.TypeMatch _ matchType _, typeSignature ) =
            case typeSignature.input of
                ((Type.Generic _) as toReplace) :: _ ->
                    { input = List.map (replaceType toReplace matchType) typeSignature.input
                    , output = List.map (replaceType toReplace matchType) typeSignature.output
                    }