<div style="font-family: 'Times New Roman'; font-size: 16px;">Thanks to Roman and Eric for for their  clear explanations.<br />Pat<br /><br /><br /><span>On 09/07/13, <b class="name">Roman Cheplyaka </b> &lt;roma@ro-che.info&gt; wrote:</span><blockquote cite="mid:20130709133428.GA5869@sniper" class="iwcQuote" style="border-left: 1px solid #00F; padding-left: 13px; margin-left: 0;" type="cite"><div class="mimepart text plain">The compiler defaults the kind of 'quality' (i.e. the first argument of<br />QUALITIES) to *, not being able to infer it from the class definition<br />itself (and other definitions that it references).<br /><br />Since you want it to have kind * -&gt; *, you should enable KindSignatures<br />and add an annotation, or otherwise disambiguate the kind.<br /><br />This behaviour follows the Haskell Report. The change from previous<br />versions of GHC is documented here:<br /><a href="http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/release-7-4-1.html#id3015054" target="_blank">http://www.haskell.org/ghc/docs/7.4.1/html/users_guide/release-7-4-1.html#id3015054</a><br /><br />Roman<br /><br />* Patrick Browne &lt;patrick.browne@dit.ie&gt; [2013-07-09 12:45:19+0100]<br />&gt;    Hi,<br />&gt;    The code [1] below compiles and runs with GHCi version 7.0.4.<br />&gt;    I get one warning and an error message with GHCi version 7.6.1.<br />&gt;    1)  Warning -XDatatypeContexts is deprecated. Unless there are<br />&gt;    propagation effects, this is well explained.<br />&gt;    2) foom-1.hs:65:15:<br />&gt;        `quality' is applied to too many type arguments<br />&gt;        In the type `quality entity -&gt; agent -&gt; IO Observation'<br />&gt;        In the class declaration for `OBSERVERS'<br />&gt;    Failed, modules loaded: none.<br />&gt;    I do not understand the error message from 7.6.1.<br />&gt;    I am not too interested actually fixing it, I just want to understand<br />&gt;    it.<br />&gt;    Thanks,<br />&gt;    Pat<br />&gt;    [1]The code is from: A Functional Ontology of Observation and<br />&gt;    Measurement Werner Kuhn<br />&gt;    {-# LANGUAGE DatatypeContexts,MultiParamTypeClasses  #-}<br />&gt;    module ENDURANTS where<br />&gt;    import System.Time<br />&gt;    type Id = String<br />&gt;    type Position = Integer<br />&gt;    type Moisture = Float<br />&gt;    type Celsius = String<br />&gt;    type Heat =  Float<br />&gt;    data WeatherStation = WeatherStation Id Position deriving Show<br />&gt;    data Value = Boolean Bool | Count Int | Measure Float | Category String<br />&gt;    deriving Show<br />&gt;    data Observation = Observation Value Position ClockTime deriving Show<br />&gt;    data AmountOfAir = AmountOfAir Heat Moisture  deriving Show<br />&gt;    muensterAir = AmountOfAir  10.0 70.0<br />&gt;    class ENDURANTS endurant where<br />&gt; <br />&gt;    -- must add instances all down the hierarchy for each instance<br />&gt;    instance ENDURANTS WeatherStation where<br />&gt;    instance ENDURANTS AmountOfAir where<br />&gt;    class ENDURANTS physicalEndurant =&gt; PHYSICAL_ENDURANTS physicalEndurant<br />&gt;    where<br />&gt;    instance PHYSICAL_ENDURANTS WeatherStation where<br />&gt;    instance PHYSICAL_ENDURANTS AmountOfAir where<br />&gt;    class PHYSICAL_ENDURANTS  amountOfMatter =&gt; AMOUNTS_OF_MATTER<br />&gt;    amountOfMatter where<br />&gt;    instance AMOUNTS_OF_MATTER   WeatherStation where<br />&gt;    class PHYSICAL_ENDURANTS physicalObject =&gt; PHYSICAL_OBJECTS<br />&gt;    physicalObject where<br />&gt;    instance PHYSICAL_OBJECTS WeatherStation where<br />&gt;    class PHYSICAL_OBJECTS apo =&gt; APOS apo where<br />&gt;     getPosition :: apo -&gt; Position<br />&gt;    instance APOS WeatherStation where<br />&gt;     getPosition (WeatherStation iD pos) = pos + 10<br />&gt; <br />&gt;    -- a data type declaration and data type constructor.<br />&gt;    data PHYSICAL_ENDURANTS physicalEndurant =&gt; Temperature<br />&gt;    physicalEndurant = Temperature physicalEndurant deriving Show<br />&gt;    -- Qualities the class of all quality types (= properties) is a<br />&gt;    constructor class<br />&gt;    -- its constructors can be applied to endurants, perdurants, qualities<br />&gt;    or abstracts<br />&gt;    class QUALITIES quality entity<br />&gt;    instance QUALITIES Temperature AmountOfAir<br />&gt;    class (APOS agent, QUALITIES quality entity) =&gt; OBSERVERS agent quality<br />&gt;    entity where<br />&gt;       observe :: quality entity -&gt; agent -&gt; IO Observation<br />&gt;       express :: quality entity -&gt; agent -&gt; Value<br />&gt;       observe quale agent = do<br />&gt;                           clockTime &lt;- getClockTime<br />&gt;                           return (Observation (express quale agent)<br />&gt;                                      (getPosition agent) clockTime)<br />&gt;    instance OBSERVERS WeatherStation Temperature AmountOfAir where<br />&gt;      express (Temperature (AmountOfAir heat moisture)) weatherStation =<br />&gt;    Measure heat<br />&gt;    {-<br />&gt;    -- running the following<br />&gt;    express (Temperature (AmountOfAir 40 20)) (WeatherStation &quot;rr&quot; 6)<br />&gt;    -- Gives<br />&gt;    Measure 40.0 Measure 40.0<br />&gt;    -- We can get the type: Value<br />&gt;    :t express (Temperature (AmountOfAir 40 20)) (WeatherStation &quot;rr&quot; 6)<br />&gt;    -}<br />&gt; <br />&gt;    Tá an teachtaireacht seo scanta ó thaobh ábhar agus víreas ag Seirbhís<br />&gt;    Scanta Ríomhphost de chuid Seirbhísí Faisnéise, ITBÁC agus meastar í a<br />&gt;    bheith slán. [1]<a href="http://www.dit.ie" target="_blank">http://www.dit.ie</a><br />&gt;    This message has been scanned for content and viruses by the DIT<br />&gt;    Information Services E-Mail Scanning Service, and is believed to be<br />&gt;    clean. [2]<a href="http://www.dit.ie" target="_blank">http://www.dit.ie</a><br />&gt; <br />&gt; References<br />&gt; <br />&gt;    1. <a href="http://www.dit.ie/" target="_blank">http://www.dit.ie/</a><br />&gt;    2. <a href="http://www.dit.ie/" target="_blank">http://www.dit.ie/</a><br /><br />&gt; _______________________________________________<br />&gt; Haskell-Cafe mailing list<br />&gt; Haskell-Cafe@haskell.org<br />&gt; <a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br /><br /></div></blockquote></div>
<br clear=all> Tá an teachtaireacht seo scanta ó thaobh ábhar agus víreas ag Seirbhís Scanta Ríomhphost de chuid Seirbhísí Faisnéise, ITBÁC agus meastar í a bheith slán.  <a href="http://www.dit.ie">http://www.dit.ie</a><br>
This message has been scanned for content and viruses by the DIT Information Services E-Mail Scanning Service, and is believed to be clean.  <a href="http://www.dit.ie">http://www.dit.ie</a>