paf31 / purescript-book

Sources for the PureScript book
454 stars 370 forks source link

6.6 Compiler shows an error #142

Closed alexandradeas closed 6 years ago

alexandradeas commented 6 years ago

In 6.6 Overlapping Instances, with:

module Overlapped where

import Prelude

data T = T

instance showT1 :: Show T where
  show _ = "Instance 1"

instance showT2 :: Show T where
  show _ = "Instance 2"

The text then goes on to read This module will compile with no warnings however when compiling with v0.12 I get:

  Overlapping type class instances found for

    Data.Show.Show T

  The following instances were found:

    Overlapped.showT1
    Overlapped.showT2

in type class instance

  Data.Show.Show T
alexandradeas commented 6 years ago

Noticed that there's already #136 and @jw120 seems to have already resolved the issue in his update.