1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
demo@qemuhost:~/HTrain$ make
cabal v2-build  htrain
Up to date
ghc -O2 -Wall --make Setup -package Cabal
touch Setup
cabal v2-build -j  trainLLM
Build profile: -w ghc-9.0.2 -O1
In order, the following will be built (use -v for more details):
 - htrain-0.0.1 (exe:trainLLM) (file programs/trainLLM.hs changed)
Preprocessing executable 'trainLLM' for htrain-0.0.1..
Building executable 'trainLLM' for htrain-0.0.1..
[1 of 1] Compiling Main             ( programs/trainLLM.hs, /home/demo/HTrain/dist-newstyle/build/x86_64-linux/ghc-9.0.2/htrain-0.0.1/x/trainLLM/build/trainLLM/trainLLM-tmp/Main.o )

programs/trainLLM.hs:158:10: error:
    • Overlapping instances for FromJSON Vocab
        arising from a use of ‘aeson-2.2.3.0:Data.Aeson.Types.FromJSON.$dmparseJSONList’
      Matching instances:
        instance (ghc-prim-0.7.0:GHC.Classes.Eq k,
                  hashable-1.4.7.0:Data.Hashable.Class.Hashable k,
                  aeson-2.2.3.0:Data.Aeson.Types.FromJSON.FromJSONKey k,
                  FromJSON v) =>
                 FromJSON (InsOrdHashMap k v)
          -- Defined in ‘Data.HashMap.Strict.InsOrd’
        instance FromJSON Vocab -- Defined at programs/trainLLM.hs:158:10
    • In the expression:
        aeson-2.2.3.0:Data.Aeson.Types.FromJSON.$dmparseJSONList @(Vocab)
      In an equation for ‘aeson-2.2.3.0:Data.Aeson.Types.FromJSON.parseJSONList’:
          aeson-2.2.3.0:Data.Aeson.Types.FromJSON.parseJSONList
            = aeson-2.2.3.0:Data.Aeson.Types.FromJSON.$dmparseJSONList @(Vocab)
      In the instance declaration for ‘FromJSON Vocab’
    |
158 | instance FromJSON Vocab where
    |          ^^^^^^^^^^^^^^

programs/trainLLM.hs:158:10: error:
    • Overlapping instances for FromJSON Vocab
        arising from a use of ‘aeson-2.2.3.0:Data.Aeson.Types.FromJSON.$dmomittedField’
      Matching instances:
        instance (ghc-prim-0.7.0:GHC.Classes.Eq k,
                  hashable-1.4.7.0:Data.Hashable.Class.Hashable k,
                  aeson-2.2.3.0:Data.Aeson.Types.FromJSON.FromJSONKey k,
                  FromJSON v) =>
                 FromJSON (InsOrdHashMap k v)
          -- Defined in ‘Data.HashMap.Strict.InsOrd’
        instance FromJSON Vocab -- Defined at programs/trainLLM.hs:158:10
    • In the expression:
        aeson-2.2.3.0:Data.Aeson.Types.FromJSON.$dmomittedField @(Vocab)
      In an equation for ‘aeson-2.2.3.0:Data.Aeson.Types.FromJSON.omittedField’:
          aeson-2.2.3.0:Data.Aeson.Types.FromJSON.omittedField
            = aeson-2.2.3.0:Data.Aeson.Types.FromJSON.$dmomittedField @(Vocab)
      In the instance declaration for ‘FromJSON Vocab’
    |
158 | instance FromJSON Vocab where
    |          ^^^^^^^^^^^^^^

programs/trainLLM.hs:297:33: error:
    • Overlapping instances for FromJSON Vocab
        arising from a use of ‘decodeFileStrict’
      Matching instances:
        instance (ghc-prim-0.7.0:GHC.Classes.Eq k,
                  hashable-1.4.7.0:Data.Hashable.Class.Hashable k,
                  aeson-2.2.3.0:Data.Aeson.Types.FromJSON.FromJSONKey k,
                  FromJSON v) =>
                 FromJSON (InsOrdHashMap k v)
          -- Defined in ‘Data.HashMap.Strict.InsOrd’
        instance FromJSON Vocab -- Defined at programs/trainLLM.hs:158:10
    • In the expression: decodeFileStrict inFile
      In a case alternative: Just inFile -> decodeFileStrict inFile
      In a stmt of a 'do' block:
        input <- case dictionaryOpt rawArgs of
                   Nothing
                     -> error
                          "This example requires you to pass in your own dictionary, in JSON format."
                   Just inFile -> decodeFileStrict inFile
    |
297 |                  Just inFile -> decodeFileStrict inFile
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^
make: *** [Makefile:137: dist-newstyle/build/x86_64-linux/ghc-9.0.2/htrain-0.0.1/x//trainLLM/build/trainLLM/trainLLM] Error 1
demo@qemuhost:~/HTrain$