Skip to content

Instantly share code, notes, and snippets.

@sajith
Created October 21, 2018 13:43
Show Gist options
  • Save sajith/95ab4c75bd11eb2c24ec52aa1e057140 to your computer and use it in GitHub Desktop.
Save sajith/95ab4c75bd11eb2c24ec52aa1e057140 to your computer and use it in GitHub Desktop.
Prelude> :load microlens-ex.hs
[1 of 1] Compiling Main ( microlens-ex.hs, interpreted )
microlens-ex.hs:17:5: error:
• No instance for (Data.String.IsString (Maybe Text))
arising from the literal ‘"true"’
• In the first argument of ‘(&)’, namely ‘"true"’
In the expression: "true" & _Bool .~ False
In an equation for ‘b’: b = "true" & _Bool .~ False
|
17 | b = "true" & _Bool .~ False -- "false"
| ^^^^^^
microlens-ex.hs:17:14: error:
• No instance for (AsPrimitive (Maybe Text))
arising from a use of ‘_Bool’
• In the first argument of ‘(.~)’, namely ‘_Bool’
In the second argument of ‘(&)’, namely ‘_Bool .~ False’
In the expression: "true" & _Bool .~ False
|
17 | b = "true" & _Bool .~ False -- "false"
| ^^^^^
microlens-ex.hs:24:5: error:
• Ambiguous type variable ‘s2’ arising from the literal ‘"[1, 2, 3]"’
prevents the constraint ‘(Data.String.IsString
s2)’ from being solved.
Probable fix: use a type annotation to specify what ‘s2’ should be.
These potential instances exist:
instance Data.String.IsString Value
-- Defined in ‘aeson-1.2.4.0:Data.Aeson.Types.Internal’
instance Data.String.IsString Text -- Defined in ‘Data.Text’
instance a ~ Char => Data.String.IsString [a]
-- Defined in ‘Data.String’
...plus 8 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the first argument of ‘(^..)’, namely ‘"[1, 2, 3]"’
In the expression: "[1, 2, 3]" ^.. values
In an equation for ‘c’: c = "[1, 2, 3]" ^.. values
|
24 | c = "[1, 2, 3]" ^.. values -- [Number 1.0, Number 2.0, Number 3.0]
| ^^^^^^^^^^^
microlens-ex.hs:24:21: error:
• Ambiguous type variable ‘s2’ arising from a use of ‘values’
prevents the constraint ‘(AsValue s2)’ from being solved.
Probable fix: use a type annotation to specify what ‘s2’ should be.
These potential instances exist:
instance AsValue Value -- Defined in ‘Lens.Micro.Aeson’
instance AsValue Text -- Defined in ‘Lens.Micro.Aeson’
instance AsValue String -- Defined in ‘Lens.Micro.Aeson’
...plus three instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the second argument of ‘(^..)’, namely ‘values’
In the expression: "[1, 2, 3]" ^.. values
In an equation for ‘c’: c = "[1, 2, 3]" ^.. values
|
24 | c = "[1, 2, 3]" ^.. values -- [Number 1.0, Number 2.0, Number 3.0]
| ^^^^^^
microlens-ex.hs:28:5: error:
• Ambiguous type variable ‘s1’ arising from the literal ‘"[1, 2, 3]"’
prevents the constraint ‘(Data.String.IsString
s1)’ from being solved.
Probable fix: use a type annotation to specify what ‘s1’ should be.
These potential instances exist:
instance Data.String.IsString Value
-- Defined in ‘aeson-1.2.4.0:Data.Aeson.Types.Internal’
instance Data.String.IsString Text -- Defined in ‘Data.Text’
instance a ~ Char => Data.String.IsString [a]
-- Defined in ‘Data.String’
...plus 8 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the first argument of ‘(^..)’, namely ‘"[1, 2, 3]"’
In the expression: "[1, 2, 3]" ^.. values . _Double
In an equation for ‘d’: d = "[1, 2, 3]" ^.. values . _Double
|
28 | d = "[1, 2, 3]" ^.. values . _Double -- [1.0, 2.0, 3.0]
| ^^^^^^^^^^^
microlens-ex.hs:28:21: error:
• Ambiguous type variable ‘s1’ arising from a use of ‘values’
prevents the constraint ‘(AsValue s1)’ from being solved.
Probable fix: use a type annotation to specify what ‘s1’ should be.
These potential instances exist:
instance AsValue Value -- Defined in ‘Lens.Micro.Aeson’
instance AsValue Text -- Defined in ‘Lens.Micro.Aeson’
instance AsValue String -- Defined in ‘Lens.Micro.Aeson’
...plus three instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the first argument of ‘(.)’, namely ‘values’
In the second argument of ‘(^..)’, namely ‘values . _Double’
In the expression: "[1, 2, 3]" ^.. values . _Double
|
28 | d = "[1, 2, 3]" ^.. values . _Double -- [1.0, 2.0, 3.0]
| ^^^^^^
microlens-ex.hs:49:5: error:
• Ambiguous type variable ‘s0’ arising from the literal ‘"{\"a\":4,\"b\":7}"’
prevents the constraint ‘(Data.String.IsString
s0)’ from being solved.
Probable fix: use a type annotation to specify what ‘s0’ should be.
These potential instances exist:
instance Data.String.IsString Value
-- Defined in ‘aeson-1.2.4.0:Data.Aeson.Types.Internal’
instance Data.String.IsString Text -- Defined in ‘Data.Text’
instance a ~ Char => Data.String.IsString [a]
-- Defined in ‘Data.String’
...plus 8 instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the first argument of ‘(^?)’, namely ‘"{\"a\":4,\"b\":7}"’
In the expression: "{\"a\":4,\"b\":7}" ^? _Value
In an equation for ‘h’: h = "{\"a\":4,\"b\":7}" ^? _Value
|
49 | h = "{\"a\":4,\"b\":7}" ^? _Value
| ^^^^^^^^^^^^^^^^^^^
microlens-ex.hs:49:28: error:
• Ambiguous type variable ‘s0’ arising from a use of ‘_Value’
prevents the constraint ‘(AsValue s0)’ from being solved.
Probable fix: use a type annotation to specify what ‘s0’ should be.
These potential instances exist:
instance AsValue Value -- Defined in ‘Lens.Micro.Aeson’
instance AsValue Text -- Defined in ‘Lens.Micro.Aeson’
instance AsValue String -- Defined in ‘Lens.Micro.Aeson’
...plus three instances involving out-of-scope types
(use -fprint-potential-instances to see them all)
• In the second argument of ‘(^?)’, namely ‘_Value’
In the expression: "{\"a\":4,\"b\":7}" ^? _Value
In an equation for ‘h’: h = "{\"a\":4,\"b\":7}" ^? _Value
|
49 | h = "{\"a\":4,\"b\":7}" ^? _Value
| ^^^^^^
Failed, no modules loaded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment