{"action":"created","issue":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/1","labels_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/1/comments","events_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/1/events","html_url":"https://github.com/Gabriel439/Haskell-Turtle-Library/issues/1","id":56007805,"number":1,"title":"Test case fails, could not deduce (IsString (f a1))","user":{"login":"MP2E","id":167708,"avatar_url":"https://avatars.githubusercontent.com/u/167708?v=3","gravatar_id":"","url":"https://api.github.com/users/MP2E","html_url":"https://github.com/MP2E","followers_url":"https://api.github.com/users/MP2E/followers","following_url":"https://api.github.com/users/MP2E/following{/other_user}","gists_url":"https://api.github.com/users/MP2E/gists{/gist_id}","starred_url":"https://api.github.com/users/MP2E/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MP2E/subscriptions","organizations_url":"https://api.github.com/users/MP2E/orgs","repos_url":"https://api.github.com/users/MP2E/repos","events_url":"https://api.github.com/users/MP2E/events{/privacy}","received_events_url":"https://api.github.com/users/MP2E/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-30T08:41:23Z","updated_at":"2015-01-30T17:33:23Z","closed_at":null,"body":"````\r\nTest suite tests: RUNNING...\r\n### Failure in src/Turtle/Pattern.hs:29: expression `:{\r\nlet bit = (\"0\" *> pure False) <|> (\"1\" *> pure True);\r\n    portableBitMap = do\r\n        { \"P1\"\r\n        ; width  <- spaces1 *> decimal\r\n        ; height <- spaces1 *> decimal\r\n        ; count width (count height (spaces1 *> bit))\r\n        };\r\nin  match (prefix portableBitMap) \"P1\\n2 2\\n0 0\\n1 0\\n\"\r\n:}'\r\nexpected: [[[False,False],[True,False]]]\r\n but got: \r\n          <interactive>:31:5:\r\n              Could not deduce (IsString (f a1))\r\n                arising from the ambiguity check for ‘bit’\r\n              from the context (IsString (f a2), IsString (f a), Alternative f)\r\n                bound by the inferred type for ‘bit’:\r\n                           (IsString (f a2), IsString (f a), Alternative f) => f Bool\r\n                at <interactive>:31:5-52\r\n              The type variable ‘a1’ is ambiguous\r\n              When checking that ‘bit’\r\n                has the inferred type ‘forall (f :: * -> *) a a1.\r\n                                       (IsString (f a1), IsString (f a), Alternative f) =>\r\n                                       f Bool’\r\n              Probable cause: the inferred type is ambiguous\r\n              In the expression:\r\n                let\r\n                  bit = (\"0\" *> pure False) <|> (\"1\" *> pure True)\r\n                  portableBitMap = do { ... }\r\n                in\r\n                  match\r\n                    (prefix portableBitMap)\r\n                    \"P1\\n\\\r\n                    \\2 2\\n\\\r\n                    \\0 0\\n\\\r\n                    \\1 0\"\r\n              In an equation for ‘it’:\r\n                  it\r\n                    = let\r\n                        bit = (\"0\" *> pure False) <|> (\"1\" *> pure True)\r\n                        portableBitMap = ...\r\n                      in\r\n                        match\r\n                          (prefix portableBitMap)\r\n                          \"P1\\n\\\r\n                          \\2 2\\n\\\r\n                          \\0 0\\n\\\r\n                          \\1 0\"\r\nExamples: 111  Tried: 111  Errors: 0  Failures: 1\r\nTest suite tests: FAIL\r\nTest suite logged to: dist/test/turtle-1.0.0-tests.log\r\n0 of 1 test suites (0 of 1 test cases) passed.\r\n````\r\nThis is with GHC 7.8.4 on Linux x86_64 (NixOS)\r\n\r\nReading through the docs and this looks great! Looking forward to using GHCi as my shell :)"},"comment":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/comments/72238457","html_url":"https://github.com/Gabriel439/Haskell-Turtle-Library/issues/1#issuecomment-72238457","issue_url":"https://api.github.com/repos/Gabriel439/Haskell-Turtle-Library/issues/1","id":72238457,"user":{"login":"Gabriel439","id":1313787,"avatar_url":"https://avatars.githubusercontent.com/u/1313787?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel439","html_url":"https://github.com/Gabriel439","followers_url":"https://api.github.com/users/Gabriel439/followers","following_url":"https://api.github.com/users/Gabriel439/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel439/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel439/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel439/subscriptions","organizations_url":"https://api.github.com/users/Gabriel439/orgs","repos_url":"https://api.github.com/users/Gabriel439/repos","events_url":"https://api.github.com/users/Gabriel439/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel439/received_events","type":"User","site_admin":false},"created_at":"2015-01-30T17:33:23Z","updated_at":"2015-01-30T17:33:23Z","body":"I think the solution is to just add a type annotation to `bit`, like this:\r\n\r\n```haskell\r\nlet bit = (\"0\" *> pure False) <|> (\"1\" *> pure True) :: Pattern Bool;\r\n```\r\n\r\nCan you check to see if that works?  If so then I'll write up the patch."}}