11 months agoFix error recovery for pattern synonyms ghc-8.6.1-alpha1
Simon Peyton Jones [Mon, 25 Jun 2018 10:42:46 +0000 (11:42 +0100)] 
Fix error recovery for pattern synonyms

As Trac #15289 showed, we were carrying on after a type error
in a pattern synonym, and then crashing.  This patch improves
error handling for pattern synonyms.

I also moved a bit of code from TcBinds into TcPatSyn, which
helpfully narrows the API.

(cherry picked from commit 2896082ec79f02b6388e038a8dae6cb22fe72dfc)

11 months agoAPI Annotations when parsing typapp
Alan Zimmerman [Tue, 26 Jun 2018 09:07:07 +0000 (11:07 +0200)] 
API Annotations when parsing typapp

Make sure the original annotations are still accessible for a promoted

Closes #15303

(cherry picked from commit e53c113dcfeca9ee957722ede3d8b6a2c4c751a1)

11 months agoFix TcLevel manipulation in TcDerivInfer.simplifyDeriv
Simon Peyton Jones [Mon, 25 Jun 2018 16:42:57 +0000 (17:42 +0100)] 
Fix TcLevel manipulation in TcDerivInfer.simplifyDeriv

The level numbers we were getting simply didn't obey the
invariant (ImplicInv) in TcType
   Note [TcLevel and untouchable type variables]

That leads to chaos. Easy to fix.  I improved the documentation.

I also added an assertion in TcSimplify that checks that
level numbers go up by 1 as we dive inside implications, so
that we catch the problem at source rather than than through
its obscure consequences.

That in turn showed up that TcRules was also generating
constraints that didn't obey (ImplicInv), so I fixed that too.
I have no idea what consequences were lurking behing that
bug, but anyway now it's fixed.  Hooray.

(cherry picked from commit 261dd83cacec71edd551e9c581d05285c9ea3226)

11 months agoRefactor the kind-checking of tyvar binders
Simon Peyton Jones [Mon, 25 Jun 2018 12:20:59 +0000 (13:20 +0100)] 
Refactor the kind-checking of tyvar binders

The refactoring here is driven by the ghastly mess described in
comment:24 of Trac #1520.  The overall goal is to simplify the
kind-checking of typev-variable binders, and in particular to narrow
the use of the "in-scope tyvar binder" stuff,
which is needed only for associated types: see the new
Note [Kind-checking tyvar binders for associated types] in TcHsType.


* The "in-scope tyvar binder" stuff is done only in
     - kcLHsQTyVars, which is used for the LHsQTyVars of a
       data/newtype, or type family declaration.

     - tcFamTyPats, which is used for associated family instances;
       it now calls tcImplicitQTKBndrs, which in turn usese

* tcExpicitTKBndrs (which is used only for function signatures,
  data con signatures, pattern synonym signatures, and expression
  type signatures) now does not go via the "in-scope tyvar binder"
  stuff at all.

While I'm still not happy with all this code, the code is generally
simpler, and I think this is a useful step forward. It does cure
the problem too.

(It's hard to trigger the problem in vanilla Haskell code, because
the renamer would normally use different names for nested binders,
so I can't offer a test.)

(cherry picked from commit 9fc40c733ba8822a04bd92883801b214dee099ca)

11 months agoInstances in no-evidence implications
Simon Peyton Jones [Fri, 22 Jun 2018 10:27:47 +0000 (11:27 +0100)] 
Instances in no-evidence implications

Trac #15290 showed that it's possible that we might attempt to use a
quantified constraint to solve an equality in a situation where we
don't have anywhere to put the evidence bindings.  This made GHC crash.

This patch stops the crash, but still rejects the pogram.  See
Note [Instances in no-evidence implications] in TcInteract.

Finding this bug revealed another lurking bug:

* An infelicity in the treatment of superclasses -- we were expanding
  them locally at the leaves, rather than at their binding site; see
  (3a) in Note [The superclass story].

  As a consequence, TcRnTypes.superclassesMightHelp must look inside

In more detail:

* Stop the crash, by making TcInteract.chooseInstance test for
  the no-evidence-bindings case.  In that case we simply don't
  use the instance.  This entailed a slight change to the type
  of chooseInstance.

* Make TcSMonad.getPendingScDicts (now renamed getPendingGivenScs)
  return only Givens from the /current level/; and make
  TcRnTypes.superClassesMightHelp look inside implications.

* Refactor the simpl_loop and superclass-expansion stuff in
  TcSimplify.  The logic is much easier to understand now, and
  has less duplication.

(cherry picked from commit 32eb41994f7448caf5fb6b06ed0678d79d029deb)

11 months agoTweak API Annotations for ConDeclGADT
Alan Zimmerman [Sun, 24 Jun 2018 20:00:22 +0000 (22:00 +0200)] 
Tweak API Annotations for ConDeclGADT

(cherry picked from commit 5db9f9129e7519db0c9841fbe7c14f350c23284c)

11 months agoDo not imply NoStarIsType by TypeOperators/TypeInType
Vladislav Zavialov [Sun, 24 Jun 2018 19:02:34 +0000 (15:02 -0400)] 
Do not imply NoStarIsType by TypeOperators/TypeInType

Implementation of the "Embrace TypeInType" proposal was done according
to the spec, which specified that TypeOperators must imply NoStarIsType.
This implication was meant to prevent breakage and to be removed in 2
releases.  However, compiling head.hackage has shown that this
implication only magnified the breakage, so there is no reason to have
it in the first place.

To remain in compliance with the three-release policy, we add a
workaround to define the (*) type operator even when -XStarIsType is on.

Test Plan: ./validate

Reviewers: bgamari, RyanGlScott, goldfire, phadej, hvr

Subscribers: rwbarton, thomie, carter

Differential Revision:

11 months agoTTG for IPBind had wrong extension name
Alan Zimmerman [Fri, 22 Jun 2018 19:32:19 +0000 (21:32 +0200)] 
TTG for IPBind had wrong extension name

The standard[1] for extension naming is to use the XC prefix for the
internal extension points, rather than for a new constructor.

This is violated for IPBind, having

    data IPBind id
      = IPBind
            (XIPBind id)
            (Either (Located HsIPName) (IdP id))
            (LHsExpr id)
      | XCIPBind (XXIPBind id)

Swap the usage of XIPBind and XCIPBind


Closes #15302

(cherry picked from commit 5f06cf6b6199c8f0e4921f4126f6eb15e2ff18ac)

12 months agocontainers: Bump to
Ben Gamari [Mon, 18 Jun 2018 15:58:43 +0000 (11:58 -0400)] 
containers: Bump to

Bumps containers submodule, among others.

12 months agoFix gcc.exe: error: CreateProcess: No such file or directory
Moritz Angermann [Wed, 20 Jun 2018 03:27:53 +0000 (23:27 -0400)] 
Fix gcc.exe: error: CreateProcess: No such file or directory

When GHC links binaries on windows, we pass a -L and -l flag
to gcc for each dependency in the transitive dependency
closure.  As this will usually overflow the command argument
limit on windows, we use response files to pass all arguments
to gcc.  gcc however internally passes only the -l flags via
a response file to the collect2 command, but puts the -L flags
on the command line. As such if we pass enough -L flags to
gcc--even via a response file--we will eventually overflow the
command line argument length limit due to gcc passing them
to collect2 without resorting to a response file.

To prevent this from happening we move all lirbaries into a
shared temporary folder, and only need to pass a single -L
flag to gcc.  Ideally however this was fixed in gcc.

Reviewers: bgamari, Phyx

Reviewed By: bgamari

Subscribers: erikd, rwbarton, thomie, carter

Differential Revision:

12 months agorts: A bit of cleanup of posix itimer implementation
Ben Gamari [Wed, 20 Jun 2018 03:18:12 +0000 (23:18 -0400)] 
rts: A bit of cleanup of posix itimer implementation

* Use bool instead of HsBool
* Use barf instead of sysErrorBelch; stg_exit

Test Plan: Validate

Reviewers: erikd, simonmar

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agoRemove HsEqTy and XEqTy
Ryan Scott [Wed, 20 Jun 2018 03:17:02 +0000 (23:17 -0400)] 
Remove HsEqTy and XEqTy

After commit d650729f9a0f3b6aa5e6ef2d5fba337f6f70fa60, the
`HsEqTy` constructor of `HsType` is essentially dead code. Given that
we want to remove `HsEqTy` anyway as a part of #10056 (comment:27),
let's just rip it out.

Bumps the haddock submodule.

Test Plan: ./validate

Reviewers: goldfire, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #10056

Differential Revision:

12 months agoAllow :info for (~) in GHCi
Ryan Scott [Wed, 20 Jun 2018 03:16:39 +0000 (23:16 -0400)] 
Allow :info for (~) in GHCi

`(~)` is not an identifier according to GHC's parser, which
is why GHCi's `:info` command wouldn't work on it. To rectify this,
we apply the same fix that was put in place for `(->)`: add `(~)` to
GHC's `identifier` parser production.

Test Plan: make test TEST=T10059

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, mpickering, carter

GHC Trac Issues: #10059

Differential Revision:

12 months agoconfigure: Fix libnuma detection logic
Ben Gamari [Wed, 20 Jun 2018 03:16:26 +0000 (23:16 -0400)] 
configure: Fix libnuma detection logic

Test Plan: Validate with numa support

Subscribers: rwbarton, thomie, erikd, carter

Differential Revision:

12 months agoA few more typofixes in docs/comments [ci skip]
Gabor Greif [Wed, 20 Jun 2018 14:00:50 +0000 (16:00 +0200)] 
A few more typofixes in docs/comments [ci skip]

12 months agoRevert "containers: Bump to"
Ben Gamari [Wed, 20 Jun 2018 01:40:55 +0000 (21:40 -0400)] 
Revert "containers: Bump to"

This reverts commit 50e7bff7514ebbd74976c1a9fa0db7a8275178ae.

Reverts submodule changes.

Sigh, the haskeline commit isn't quite upstream yet.

12 months agobase: Add missing instances for Data.Ord.Down
Ben Gamari [Tue, 19 Jun 2018 21:11:05 +0000 (17:11 -0400)] 
base: Add missing instances for Data.Ord.Down


 * MonadFix
 * MonadZip
 * Data
 * Foldable
 * Traversable
 * Eq1
 * Ord1
 * Read1
 * Show1
 * Generic
 * Generic1

Fixes #15098.

Reviewers: RyanGlScott, hvr

Reviewed By: RyanGlScott

Subscribers: sjakobi, rwbarton, thomie, ekmett, carter

GHC Trac Issues: #15098

Differential Revision:

12 months agofindPtr: don't search the nursery
Simon Marlow [Tue, 19 Jun 2018 21:10:55 +0000 (17:10 -0400)] 
findPtr: don't search the nursery

Test Plan: Used it in anger

Reviewers: bgamari, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agoTweak wording in documentation
Victor Nawothnig [Tue, 19 Jun 2018 21:10:28 +0000 (17:10 -0400)] 
Tweak wording in documentation

Reviewers: hvr, bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agotestsuite: Add broken test for #15289
Ben Gamari [Mon, 18 Jun 2018 23:10:10 +0000 (19:10 -0400)] 
testsuite: Add broken test for #15289

The stderr output is merely a guess at what we should expect, but currently this
is certainly broken.

12 months agotestsuite: Skip T11627a and T11627b on Darwin
Ben Gamari [Mon, 18 Jun 2018 22:34:07 +0000 (18:34 -0400)] 
testsuite: Skip T11627a and T11627b on Darwin

Darwin tends to give us a very small stack which the retainer profiler tends to
overflow. Strangely, this manifested on CircleCI yet not Harbormaster.

See #15287 and #11627.

12 months agocontainers: Bump to
Ben Gamari [Mon, 18 Jun 2018 15:58:43 +0000 (11:58 -0400)] 
containers: Bump to

Bumps containers submodule, among others.

12 months agotestsuite: Bump metrics for T5631 and T6048
Ben Gamari [Mon, 18 Jun 2018 16:08:15 +0000 (12:08 -0400)] 
testsuite: Bump metrics for T5631 and T6048

It's unclear what these are due to but they are causing the Darwin builds to

12 months agoconfigure: Bump version to 8.6.0
Richard Eisenberg [Tue, 19 Jun 2018 02:36:08 +0000 (22:36 -0400)] 
configure: Bump version to 8.6.0

Bumps haddock submodule.

12 months agoDocument and simplify tcInstTyBinders
Richard Eisenberg [Tue, 19 Jun 2018 02:36:08 +0000 (22:36 -0400)] 
Document and simplify tcInstTyBinders

This fixes #15282.

12 months agoFix API Annotations for GADT constructors
Alan Zimmerman [Mon, 18 Jun 2018 08:18:21 +0000 (10:18 +0200)] 
Fix API Annotations for GADT constructors

This patch completes the work for #14529 by making sure that all API
Annotations end up attached to a SrcSpan that appears in the final

Updates Haddock submodule

Test Plan: ./validate

Reviewers: goldfire, bgamari

Subscribers: rwbarton, thomie, mpickering, carter

GHC Trac Issues: #14529

Differential Revision:

12 months agoAdjust comments (Trac #14164)
Simon Peyton Jones [Tue, 19 Jun 2018 09:43:01 +0000 (10:43 +0100)] 
Adjust comments (Trac #14164)

12 months agoMark some TH tests as req_interp
Ömer Sinan Ağacan [Tue, 19 Jun 2018 07:16:54 +0000 (10:16 +0300)] 
Mark some TH tests as req_interp

- dataToExpQUnit
- qq005
- qq006
- qq007
- qq008
- qq009
- T13949
- T8025

12 months agoFix typo in comment only
Richard Eisenberg [Mon, 18 Jun 2018 15:18:15 +0000 (11:18 -0400)] 
Fix typo in comment only

[skip ci]

12 months agoTypofixes in docs and comments [ci skip]
Gabor Greif [Mon, 18 Jun 2018 12:22:54 +0000 (14:22 +0200)] 
Typofixes in docs and comments [ci skip]

12 months agoFix typechecking of kind signatures
Simon Peyton Jones [Sat, 16 Jun 2018 22:50:02 +0000 (23:50 +0100)] 
Fix typechecking of kind signatures

When typechecking a type like
   Maybe (a :: <kind-sig>)
with a kind signature, we were using tc_lhs_kind to
typecheck the signature.  But that's utterly wrong; we
need the signature to be fully solid (non unresolved
equalities) before using it.  In the case of Trac #14904
we went on to instantiate the kind signature, when it
still had embedded unsolved constraints.  This tripped
the level-checking assertion when unifying a variable.

The fix looks pretty easy to me: just call tcLHsKind
instead.  I had to add KindSigCtxt to

12 months agoTwo small refactorings
Simon Peyton Jones [Sat, 16 Jun 2018 22:30:26 +0000 (23:30 +0100)] 
Two small refactorings

* Define Type.substTyVarBndrs, and use it

* Rename substTyVarBndrCallback to substTyVarBndrUsing,
  and other analogous higher order functions.  I kept
  stumbling over the name.

12 months agoFix an infinite loop in niFixTCvSubst
Simon Peyton Jones [Sat, 16 Jun 2018 22:25:53 +0000 (23:25 +0100)] 
Fix an infinite loop in niFixTCvSubst

Trac #14164 made GHC loop, a pretty serious error. It turned
out that Unify.niFixTCvSubst was looping forever, because we
had a substitution like
    a :-> ....(b :: (c :: d))....
    d :-> ...
We correctly recognised that d was free in the range of the
substitution, but then failed to apply it "deeeply enough"
to the range of the substiuttion, so d was /still/ free in
the range, and we kept on going.

Trac #9106 was caused by a similar problem, but alas my
fix to Trac #9106 was inadequate when the offending type
variable is more deeply buried.  Urk.

This time I think I've fixed it!  It's much more subtle
than I though, and it took most of a long train journey
to figure it out.  I wrote a long note to explain:
Note [Finding the substitution fixpoint]

12 months agoRemove accidentally checked-in T14845.stderr
Ryan Scott [Sun, 17 Jun 2018 19:31:14 +0000 (15:31 -0400)] 
Remove accidentally checked-in T14845.stderr

This was a stderr file for a WIP test in D4728. I ended up removing
the test, but forgot to remove the stderr file.

12 months agoAdd -Werror=compat
Vladislav Zavialov [Sun, 17 Jun 2018 16:51:06 +0000 (12:51 -0400)] 
Add -Werror=compat

Add a flag `-Werror=compat` to GHC which has the effect of `-Werror=x
-Werror=y ...`, where `x, y, ...` are warnings from the `-Wcompat`
option group.

Test Plan: ./validate

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15278

Differential Revision:

12 months agoUse __FILE__ for Cmm assertion locations, fix #8619
Ömer Sinan Ağacan [Sun, 17 Jun 2018 16:50:18 +0000 (12:50 -0400)] 
Use __FILE__ for Cmm assertion locations, fix #8619

It seems like we currently support string literals in Cmm, so we can use
__LINE__ CPP macro in assertion macros. This improves error messages
that previously looked like

    ASSERTION FAILED: file (null), line 1302

(null) part now shows the actual file name.

Also inline some single-use string literals in PrimOps.cmm.

Reviewers: bgamari, simonmar, erikd

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agoUNREG: fix CmmRegOff large offset handling on W64 platforms
Sergei Trofimovich [Sun, 17 Jun 2018 16:49:51 +0000 (12:49 -0400)] 
UNREG: fix CmmRegOff large offset handling on W64 platforms

Gabor noticed C warning when building unregisterised
64-bit compiler on GHC.Integer.Types (from integer-simple).

Minimised example with a warning:

{-# LANGUAGE MagicHash #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -Wall #-}

module M (bug) where

import GHC.Prim (Word#, minusWord#, ltWord#)
import GHC.Types (isTrue#)

-- assume Word = Word64
bug :: Word# -> Word#
bug x = if isTrue# (x `ltWord#` 0x8000000000000000##) then 0##
        else x `minusWord#` 0x8000000000000000##

$ LANG=C x86_64-UNREG-linux-gnu-ghc -O1 -c M.hs -fforce-recomp
/tmp/ghc30219_0/ghc_1.hc: In function 'M_bug_entry':

/tmp/ghc30219_0/ghc_1.hc:20:14: error:
     warning: integer constant is so large that it is unsigned

It's caused by limited handling of integer literals in CmmRegOff.
This change switches to use standard integer literal pretty-printer.

C code before the change:

FN_(M_bug_entry) {
W_ _sAg;
_sAg = *Sp;
switch ((W_)(_sAg < 0x8000000000000000UL)) {
case 0x1UL: goto _cAq;
default: goto _cAp;
R1.w = _sAg+-9223372036854775808;
// ...

C code after the change:

FN_(M_bug_entry) {
W_ _sAg;
_sAg = *Sp;
switch ((W_)(_sAg < 0x8000000000000000UL)) {
case 0x1UL: goto _cAq;
default: goto _cAp;
R1.w = _sAg+(-0x8000000000000000UL);

Reported-by: Gabor Greif
Signed-off-by: Sergei Trofimovich <>
Test Plan: test generated code on unregisterised mips64 and amd64

Reviewers: simonmar, ggreif, bgamari

Reviewed By: ggreif, bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agoProvide a better error message for unpromotable data constructor contexts
Ryan Scott [Sun, 17 Jun 2018 16:28:23 +0000 (12:28 -0400)] 
Provide a better error message for unpromotable data constructor contexts

Trac #14845 brought to light a corner case where a data
constructor could not be promoted (even with `-XTypeInType`) due to
an unpromotable constraint in its context. However, the error message
was less than helpful, so this patch adds an additional check to
`tcTyVar` catch unpromotable data constructors like these //before//
they're promoted, and to give a sensible error message in such cases.

Test Plan: make test TEST="T13895 T14845"

Reviewers: simonpj, goldfire, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #13895, #14845

Differential Revision:

12 months agoImprove documentation of Eq, Ord instances for Float and Double
ARJANEN Loïc Jean David [Sun, 17 Jun 2018 15:30:28 +0000 (11:30 -0400)] 
Improve documentation of Eq, Ord instances for Float and Double

Reviewers: sjakobi, dfeuer, bgamari, hvr

Reviewed By: sjakobi, bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15078

Differential Revision:

12 months agoImprove error message when importing an unusable package
Sean D Gillespie [Sun, 17 Jun 2018 15:22:20 +0000 (11:22 -0400)] 
Improve error message when importing an unusable package

If a module cannot be found because it is ignored or from an unusable
package, report this to the user and the reason it is unusable.

Currently, GHC displays the standard "Cannot find module error". For

<no location info>: error:
    Could not find module ‘Control.Monad.Random’
    Perhaps you meant
      Control.Monad.Reader (from mtl-2.2.2)
      Control.Monad.Cont (from mtl-2.2.2)
      Control.Monad.Error (from mtl-2.2.2)

GHC does, however, indicate unusable/ignored packages with the -v flag:

package MonadRandom-0.5.1-1421RgpXdhC8e8UI7D3emA is unusable due to
missing dependencies:

With this change, I took that message and added it to the output of the
"Cannot find module" message.

Reviewers: bgamari, dfeuer

Reviewed By: bgamari

Subscribers: Phyx, dfeuer, rwbarton, thomie, carter

GHC Trac Issues: #4806

Differential Revision:

12 months agoHandle DuplicateRecordFields correctly in filterImports (fixes #14487)
Adam Gundry [Sun, 17 Jun 2018 14:47:57 +0000 (10:47 -0400)] 
Handle DuplicateRecordFields correctly in filterImports (fixes #14487)

filterImports needed a small adjustment to correctly handle record field
definitions arising from modules with DuplicateRecordFields enabled.

Previously hiding fields was not possible with DuplicateRecordFields enabled.

Test Plan: new test rename/should_compile/T14487

Reviewers: bgamari

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #14487

Differential Revision:

12 months agotestsuite: Mark print022 as broken on 32-bit platforms
Ben Gamari [Sun, 17 Jun 2018 14:33:00 +0000 (10:33 -0400)] 
testsuite: Mark print022 as broken on 32-bit platforms

Due to #15061.

12 months agotestsuite: Mark T3001-2 as broken on 32-bit platforms
Ben Gamari [Sun, 17 Jun 2018 14:31:34 +0000 (10:31 -0400)] 
testsuite: Mark T3001-2 as broken on 32-bit platforms

Due to #15063.

12 months agoconfigure: Fail when bootstrapping with GHC 8.2.1
Ben Gamari [Sun, 17 Jun 2018 13:54:18 +0000 (09:54 -0400)] 
configure: Fail when bootstrapping with GHC 8.2.1

See #15281

12 months agoBump process submodule
Ben Gamari [Sun, 17 Jun 2018 12:44:25 +0000 (08:44 -0400)] 
Bump process submodule

12 months agoRevert "rts: Use .cfi_{start|end}proc directives"
Ben Gamari [Sun, 17 Jun 2018 13:41:46 +0000 (09:41 -0400)] 
Revert "rts: Use .cfi_{start|end}proc directives"

This reverts commit 86210b238b86d810874a2315d1715546a4006cea.

12 months agoWarn about implicit kind variables with -Wcompat
Vladislav Zavialov [Sun, 17 Jun 2018 03:44:39 +0000 (23:44 -0400)] 
Warn about implicit kind variables with -Wcompat

According to an accepted proposal

    With -Wcompat, warn if a kind variable is brought into scope
    implicitly in a type with an explicit forall. This applies to type
    signatures and to other contexts that allow a forall with the
    forall-or-nothing rule in effect (for example, class instances).

Test Plan: Validate

Reviewers: goldfire, hvr, bgamari, RyanGlScott

Reviewed By: goldfire

Subscribers: RyanGlScott, rwbarton, thomie, carter

GHC Trac Issues: #15264

Differential Revision:

12 months agobase: Add default implementation for Data.Bits.bitSize
Ben Gamari [Sun, 17 Jun 2018 03:44:03 +0000 (23:44 -0400)] 
base: Add default implementation for Data.Bits.bitSize

Fixes #12970 and will provide a reasonable migration path for the
eventual remove of this function.

Test Plan: Validate

Reviewers: ekmett, hvr

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #12970

Differential Revision:

12 months agoRevert "Amend configure script to support lndir build tree"
Ben Gamari [Sun, 17 Jun 2018 03:31:07 +0000 (23:31 -0400)] 
Revert "Amend configure script to support lndir build tree"

This appears to inexplicably break the OS X build, which fails with:
make[1]: *** No rule to make target `utils/unlit/fs.c', needed by
         `utils/unlit/dist/build/.depend.c_asm'.  Stop.
make[1]: *** Waiting for unfinished jobs....
make: *** [all] Error 2

This reverts commit 8ee9c574a6d2105ace858f0fee31750acafe0a0f.

12 months agoEnhanced constant folding
Sylvain Henry [Fri, 13 Apr 2018 17:29:07 +0000 (13:29 -0400)] 
Enhanced constant folding

Until now GHC only supported basic constant folding (lit op lit, expr op
0, etc.).

This patch uses laws of +/-/* (associativity, commutativity,
distributivity) to support some constant folding into nested

Examples of new transformations:

   - simple nesting: (10 + x) + 10 becomes 20 + x
   - deep nesting: 5 + x + (y + (z + (t + 5))) becomes 10 + (x + (y + (z + t)))
   - distribution: (5 + x) * 6 becomes 30 + 6*x
   - simple factorization: 5 + x + (x + (x + (x + 5))) becomes 10 + (4 *x)
   - siblings: (5 + 4*x) - (3*x + 2) becomes 3 + x

Test Plan: validate

Reviewers: simonpj, austin, bgamari

Reviewed By: bgamari

Subscribers: thomie

GHC Trac Issues: #9136

Differential Revision:

(cherry picked from commit fea04defa64871caab6339ff3fc5511a272f37c7)

12 months agocircleci: Add a reference to the documentation on the Wiki
Ben Gamari [Sat, 16 Jun 2018 19:36:09 +0000 (15:36 -0400)] 
circleci: Add a reference to the documentation on the Wiki

12 months agocircleci: Bump fedora docker image tag
Ben Gamari [Sat, 16 Jun 2018 19:21:49 +0000 (15:21 -0400)] 
circleci: Bump fedora docker image tag

12 months agorts: Remove use of __USE_MINGW_ANSI_STDIO
Ben Gamari [Sat, 16 Jun 2018 17:22:31 +0000 (13:22 -0400)] 
rts: Remove use of __USE_MINGW_ANSI_STDIO

As pointed out in #12951, this was a temporary measure to allow GHC to be
bootstrapped on Windows with GHC 7.10. This release is now out of our bootstrap
support window so let's remove it.

12 months agobase: Improve the documentation of the enumFrom series of functions
ARJANEN Loïc Jean David [Sat, 16 Jun 2018 17:00:33 +0000 (13:00 -0400)] 
base: Improve the documentation of the enumFrom series of functions

Fixes #15134.

Reviewers: dfeuer, hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15134

Differential Revision:

12 months agoBump nofib submodule
Ben Gamari [Sat, 16 Jun 2018 16:35:16 +0000 (12:35 -0400)] 
Bump nofib submodule

12 months agoPreserve parenthesis in function application in typechecker
Zubin Duggal [Sat, 16 Jun 2018 16:19:43 +0000 (12:19 -0400)] 
Preserve parenthesis in function application in typechecker

Preserve HsPars while typechecking

Test Plan: T15242

Reviewers: bgamari, alanz, simonpj

Reviewed By: alanz, simonpj

Subscribers: simonpj, AndreasK, rwbarton, thomie, carter

GHC Trac Issues: #15242

Differential Revision:

12 months agorts: Use .cfi_{start|end}proc directives
Ben Gamari [Sat, 16 Jun 2018 15:34:28 +0000 (11:34 -0400)] 
rts: Use .cfi_{start|end}proc directives

Test Plan: Validate using LLVM assembler

Reviewers: carter, erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie

GHC Trac Issues: #15207

Differential Revision:

12 months agotestsuite: Mark overflow1 as broken on 32-bit platforms due to #15255
Ben Gamari [Sat, 16 Jun 2018 15:33:18 +0000 (11:33 -0400)] 
testsuite: Mark overflow1 as broken on 32-bit platforms due to #15255

Test Plan: Validate on i386

Reviewers: simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15255

Differential Revision:

12 months agotestsuite: Mark num009 as broken due to #15062
Ben Gamari [Sat, 16 Jun 2018 15:33:11 +0000 (11:33 -0400)] 
testsuite: Mark num009 as broken due to #15062

Test Plan: Validate

Reviewers: hvr

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15062

Differential Revision:

12 months agoAmend configure script to support lndir build tree
Adam Gundry [Sat, 16 Jun 2018 15:32:55 +0000 (11:32 -0400)] 
Amend configure script to support lndir build tree

Test Plan: ./validate

Reviewers: bgamari

Subscribers: rwbarton, thomie, erikd, carter

GHC Trac Issues: #15257

Differential Revision:

12 months agoQuantify unfixed kind variables in CUSKs
Richard Eisenberg [Thu, 14 Jun 2018 12:50:06 +0000 (08:50 -0400)] 
Quantify unfixed kind variables in CUSKs

This is a small change in user-facing behavior. When we
have a unification variable left over in a CUSK, we previously
would issue an error. But, we can just quantify. This also
teaches kcLHsQTyVars to use quantifyTyVars instead of its own,
ad-hoc quantification scheme.

Fixes #15273.

test case: polykinds/T11648b

12 months agoBuilt-in Natural literals in Core
Sylvain Henry [Fri, 15 Jun 2018 20:23:53 +0000 (16:23 -0400)] 
Built-in Natural literals in Core

Add support for built-in Natural literals in Core.

- Replace MachInt,MachWord, LitInteger, etc. with a single LitNumber
  constructor with a LitNumType field
- Support built-in Natural literals
- Add desugar warning for negative literals
- Move Maybe(..) from GHC.Base to GHC.Maybe for module dependency

This patch introduces only a few rules for Natural literals (compared
to Integer's rules). Factorization of the built-in rules for numeric
literals will be done in another patch as this one is already big to

Test Plan:
  test build with integer-simple

Reviewers: hvr, bgamari, goldfire, Bodigrim, simonmar

Reviewed By: bgamari

Subscribers: phadej, simonpj, RyanGlScott, carter, hsyl20, rwbarton,

GHC Trac Issues: #14170, #14465

Differential Revision:

12 months agoFix #13833: accept type literals with no FlexibleInstances
Kirill Zaborsky [Fri, 15 Jun 2018 18:12:58 +0000 (14:12 -0400)] 
Fix #13833: accept type literals with no FlexibleInstances

Test Plan: ./validate

Reviewers: bgamari, simonpj

Reviewed By: bgamari, simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #13833

Differential Revision:

12 months agoUse data con name instead of parent in lookupRecFieldOcc
Adam Gundry [Fri, 15 Jun 2018 18:11:22 +0000 (14:11 -0400)] 
Use data con name instead of parent in lookupRecFieldOcc

Test Plan: new tests rename/should_compile/{T14747,T15149}

Reviewers: simonpj, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14747, #15149

Differential Revision:

12 months agoMake dtrace enabled GHC work as a bootstrap compiler on FreeBSD
Ben Gamari [Fri, 15 Jun 2018 18:07:51 +0000 (14:07 -0400)] 
Make dtrace enabled GHC work as a bootstrap compiler on FreeBSD

Fixes #15040.

Reviewers: bgamari, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agoAdd "quantified constraint" context in error message, fix #15231.
HE, Tao [Fri, 15 Jun 2018 17:45:42 +0000 (13:45 -0400)] 
Add "quantified constraint" context in error message, fix #15231.

This patch adds "quantified constraint" context in error message when
UndecidableInstances checking fails for quantified constraints.
See Trac #15231:comment#1.

This patch also pretty-prints the instance head for better error messages.

Test Plan: make test TEST="T15231"

Reviewers: bgamari, simonpj

Reviewed By: simonpj

Subscribers: simonpj, rwbarton, thomie, carter

GHC Trac Issues: #15231

Differential Revision:

12 months agoMake NameSort note into proper Note
Matthew Pickering [Fri, 15 Jun 2018 17:45:17 +0000 (13:45 -0400)] 
Make NameSort note into proper Note

Reviewers: adamgundry, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agoNo Unicode in Parser.y
Vladislav Zavialov [Fri, 15 Jun 2018 17:45:03 +0000 (13:45 -0400)] 
No Unicode in Parser.y

Unicode characters in Parser.y cause build failures
on systems where the locale does not support Unicode.


Test Plan: ./validate

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, mpickering, carter

Differential Revision:

12 months agoBump supported LLVM version to 6.0
Ben Gamari [Fri, 15 Jun 2018 01:37:05 +0000 (21:37 -0400)] 
Bump supported LLVM version to 6.0

This seems to fix a number of segmentation faults.

12 months agotestsuite: Make T4442 compile on i386 and mark as broken
Ben Gamari [Fri, 15 Jun 2018 16:58:59 +0000 (12:58 -0400)] 
testsuite: Make T4442 compile on i386 and mark as broken

There are some rather suspicious failures in the 64-bit case. See #15184 for

12 months agoFix documentation for `-dth-dec-file`
Nathan Collins [Thu, 14 Jun 2018 23:36:23 +0000 (16:36 -0700)] 
Fix documentation for `-dth-dec-file`

The docs said that it took a file argument, as in
`-dth-dec-file=<file>`, but it does not take a file argument!

12 months agocircleci: Remove systemd from Fedora nsswitch configuration
Ben Gamari [Fri, 15 Jun 2018 14:02:06 +0000 (10:02 -0400)] 
circleci: Remove systemd from Fedora nsswitch configuration

Lest we end up with a non-functional user/group lookup, resulting in #15230.

12 months agoMake better "fake tycons" in error recovery
Simon Peyton Jones [Fri, 15 Jun 2018 08:46:30 +0000 (09:46 +0100)] 
Make better "fake tycons" in error recovery

Consider (Trac #15215)
  data T a = MkT ...
  data S a = ...T...MkT....

If there is an error in the definition of 'T' we add a
"fake type constructor" to the type environment, so that we
can continue to typecheck 'S'.  But we /were not/ adding
a fake anything for 'MkT' and so there was an internal
error when we met 'MkT' in the body of 'S'.

The fix is to add fake tycons for all the 'implicits' of 'T'.
This is done by mk_fake_tc in TcTyClsDecls.checkValidTyCl,
which now returns a /list/ of TyCons rather than just one.

On the way I did some refactoring:

* Rename TcTyDecls.tcAddImplicits to tcAddTyConsToGblEnv
  and make it /include/ the TyCons themeselves as well
  as their implicits

* Some incidental refactoring about tcRecSelBinds. The main
  thing is that I've avoided creating a HsValBinds that we
  immediately decompose.  That meant moving some deck chairs

NB: The new error message for the regression test T15215
has the opaque error "Illegal constraint in a type:", flagged
in Trac #14845.  But that's the fault of the latter ticket.
The fix here not to blame.

12 months agoFix corner case in typeKind, plus refactoring
Simon Peyton Jones [Fri, 15 Jun 2018 08:19:55 +0000 (09:19 +0100)] 
Fix corner case in typeKind, plus refactoring

This is a continuation of

    commit 9d600ea68c283b0d38ac663c3cc48baba6b94f57
    Author: Simon Peyton Jones <>
    Date:   Fri Jun 1 16:36:57 2018 +0100

        Expand type synonyms when Linting a forall

That patch pointed out that there was a lurking hole in
typeKind, where it could return an ill-scoped kind, because
of not expanding type synonyms enough.

This patch fixes it, quite nicely

* Use occCheckExpand to expand those synonyms (it was always
  designed for that exact purpose), and call it from

* Consequently, move occCheckExpand from TcUnify.hs to
  Type.hs, and generalise it to take a list of type variables.

I also tidied up lintType a bit.

12 months agoFix the bind-recovery type
Simon Peyton Jones [Fri, 15 Jun 2018 08:08:58 +0000 (09:08 +0100)] 
Fix the bind-recovery type

This patch uses (forall (a::*). a) for the type to
use when recovering from an error in a binding.

Previously (Trac #15276) we had (forall r (a :: TYPE r). a),
which is ill-kinded.

It's quite hard to provoke an error arising from this, because
it only happens in programs that have a type error anyway,
but in a subequent patch I make typeKind fall over if it returns
an ill-scoped kind, and that makes ghci/scripts/T13202 crash
without this fix.

12 months agoUNREG: PprC: add support for of W16 literals (Ticket #15237)
Sergei Trofimovich [Thu, 14 Jun 2018 22:13:16 +0000 (23:13 +0100)] 
UNREG: PprC: add support for of W16 literals (Ticket #15237)

Fix UNREG build failure for 32-bit targets.

This change is an equivalent of commit
("UNREG: PprC: add support for of W32 literals")

The change allows combining two subwords into one word
on 32-bit targets. Tested on nios2-unknown-linux-gnu.

GHC Trac Issues: #15237

Signed-off-by: Sergei Trofimovich <>
12 months agoExclude libraries/libiserv/ and other things via .gitignore.
HE, Tao [Thu, 14 Jun 2018 23:25:37 +0000 (19:25 -0400)] 
Exclude libraries/libiserv/ and other things via .gitignore.

The file is generated by `./boot` and should be excluded from git
via .gitignore, since the file `` may have different line ends on

The file GNUmakefile and dir dist, dist-install should also be excluded
via .gitignore, just as other libraries.

Test Plan: [skip ci]

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: osa1, rwbarton, thomie, carter

Differential Revision:

12 months agoFix broken link
Nathan Collins [Thu, 14 Jun 2018 22:00:22 +0000 (15:00 -0700)] 
Fix broken link


12 months agoBump haddock submodule
Ben Gamari [Thu, 14 Jun 2018 22:06:23 +0000 (18:06 -0400)] 
Bump haddock submodule

12 months agoFix binary and haddock submodule commits
Ben Gamari [Thu, 14 Jun 2018 20:25:21 +0000 (16:25 -0400)] 
Fix binary and haddock submodule commits

12 months agoRevert "rts: Don't keep findPtr symbol alive if not -DDEBUG"
Ben Gamari [Thu, 14 Jun 2018 21:18:29 +0000 (17:18 -0400)] 
Revert "rts: Don't keep findPtr symbol alive if not -DDEBUG"

This reverts commit e4c41ec2b1f2f222c9c8a83ef64d4e566aa47a44. isn't processed by CPP.

12 months agoRevert inadvertant changes to .gitmodules
Ben Gamari [Thu, 14 Jun 2018 19:33:33 +0000 (15:33 -0400)] 
Revert inadvertant changes to .gitmodules

12 months agoEmbrace -XTypeInType, add -XStarIsType
Vladislav Zavialov [Thu, 14 Jun 2018 19:02:36 +0000 (15:02 -0400)] 
Embrace -XTypeInType, add -XStarIsType

Implement the "Embrace Type :: Type" GHC proposal,

GHC 8.0 included a major change to GHC's type system: the Type :: Type
axiom. Though casual users were protected from this by hiding its
features behind the -XTypeInType extension, all programs written in GHC
8+ have the axiom behind the scenes. In order to preserve backward
compatibility, various legacy features were left unchanged. For example,
with -XDataKinds but not -XTypeInType, GADTs could not be used in types.
Now these restrictions are lifted and -XTypeInType becomes a redundant
flag that will be eventually deprecated.

* Incorporate the features currently in -XTypeInType into the
  -XPolyKinds and -XDataKinds extensions.
* Introduce a new extension -XStarIsType to control how to parse * in
  code and whether to print it in error messages.

Test Plan: Validate

Reviewers: goldfire, hvr, bgamari, alanz, simonpj

Reviewed By: goldfire, simonpj

Subscribers: rwbarton, thomie, mpickering, carter

GHC Trac Issues: #15195

Differential Revision:

12 months agorelnotes: Add mention of QuantifiedConstraints
Ben Gamari [Thu, 14 Jun 2018 15:44:36 +0000 (11:44 -0400)] 
relnotes: Add mention of QuantifiedConstraints

12 months agorts: Don't keep findPtr symbol alive if not -DDEBUG
Ben Gamari [Thu, 14 Jun 2018 15:37:05 +0000 (11:37 -0400)] 
rts: Don't keep findPtr symbol alive if not -DDEBUG

Test Plan: Test with Hadrian

Reviewers: simonmar, snowleopard, erikd

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agodesugar: Rip out unsafeGlobalDynFlags usage in decomposeRuleLhs
Ben Gamari [Thu, 14 Jun 2018 13:19:51 +0000 (09:19 -0400)] 
desugar: Rip out unsafeGlobalDynFlags usage in decomposeRuleLhs

Reviewers: dfeuer

Reviewed By: dfeuer

Subscribers: dfeuer, rwbarton, thomie, carter

Differential Revision:

12 months agorts: Ignore RLIMIT_AS if it is zero
Ben Gamari [Thu, 14 Jun 2018 13:19:11 +0000 (09:19 -0400)] 
rts: Ignore RLIMIT_AS if it is zero

Reviewers: erikd, simonmar

Reviewed By: simonmar

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #14492

Differential Revision:

12 months agoReplace `showSDocUnsafe` with `showSDoc` in extending_ghc.rst
HE, Tao [Thu, 14 Jun 2018 13:18:49 +0000 (09:18 -0400)] 
Replace `showSDocUnsafe` with `showSDoc` in extending_ghc.rst

... and fix compile errors.

Replace the usage of `showSDocUnsafe` with `showSDoc dflags`
in example code in extending_ghc.rts.

This example contains several compile errors (missing import
and syntax error), this patch also fixes that.

Test Plan: [skip ci]

Reviewers: bgamari, mpickering

Reviewed By: mpickering

Subscribers: mpickering, rwbarton, thomie, carter

GHC Trac Issues: #15228

Differential Revision:

12 months agoFix deserialization of docs (#15240)
Simon Jakobi [Thu, 14 Jun 2018 13:18:35 +0000 (09:18 -0400)] 
Fix deserialization of docs (#15240)

We were using Map.fromDistinctAscList to deserialize a
(Map Name HsDocString). As the Names' Uniques had changed, we
ended up with an invalid map in which we couldn't lookup certain keys.

Switching to Map.fromList fixed the issue.

Added comments in several places.

Reviewers: alexbiehl, hvr, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15240

Differential Revision:

12 months agousers-guide: Fix PtrRepLifted to LiftedRep
Takenobu Tani [Thu, 14 Jun 2018 13:18:19 +0000 (09:18 -0400)] 
users-guide: Fix PtrRepLifted to LiftedRep

Fix `TYPE 'PtrRepLifted` to `TYPE 'LiftedRep`

[ci skip]

Test Plan: build

Reviewers: bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agoMark test broken on powerpc64[le]
Peter Trommler [Thu, 14 Jun 2018 13:15:40 +0000 (09:15 -0400)] 
Mark test broken on powerpc64[le]

Test num009 fails different results. #15062 lists more issues on other
platforms. Test T14894 fails because DWARF support is not implemented in
the PowerPC native code backend. T5435_v_asm_b fails because the runtime
linker is not implemented for PowerPC 64-bit systems.

Test Plan: validate

Reviewers: bgamari, hvr, erikd, simonmar

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #13634, #11261, #11259, #15062

Differential Revision:

12 months agoMake Control.Exception.throw levity polymorphic.
Félix Baylac-Jacqué [Thu, 14 Jun 2018 13:15:26 +0000 (09:15 -0400)] 
Make Control.Exception.throw levity polymorphic.

Test Plan: Validate.

Reviewers: hvr, bgamari, sighingnow

Reviewed By: sighingnow

Subscribers: tdammers, sighingnow, rwbarton, thomie, carter

GHC Trac Issues: #15180

Differential Revision:

12 months agoDisable `-fdefer-out-of-scope-variables` in ghci.
HE, Tao [Thu, 14 Jun 2018 13:14:58 +0000 (09:14 -0400)] 
Disable `-fdefer-out-of-scope-variables` in ghci.

We have already disabled `-fdefer-type-errors` and
`-fdefer-typed-holes` in ghci.
This patch disables `-fdefer-out-of-scope-variables` as well.

Fixes Trac #15259, as well as #14963.

Test Plan: make test TEST="T15259 T14963a T14963b T14963c"

Reviewers: bgamari, tdammers

Reviewed By: tdammers

Subscribers: tdammers, rwbarton, thomie, carter

GHC Trac Issues: #15259, #14963

Differential Revision:

12 months agoUNREG: PprC: add support for of W32 literals
Sergei Trofimovich [Thu, 14 Jun 2018 13:13:32 +0000 (09:13 -0400)] 
UNREG: PprC: add support for of W32 literals

Today UNREG build fails to generate sub-word literals:
  rts_dist_HC rts/dist/build/StgStartup.o
ghc-stage1: panic! (the 'impossible' happened)
  (GHC version 8.5.20180612 for x86_64-unknown-linux):
        pprStatics: cannot emit a non-word-sized static literal

The change allows combining two subwords into one word.

Signed-off-by: Sergei Trofimovich <>
Reviewers: simonmar, bgamari

Reviewed By: bgamari

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15237

Differential Revision:

12 months agotestsuite: Fix T4442 on i386
Ben Gamari [Thu, 14 Jun 2018 13:13:11 +0000 (09:13 -0400)] 
testsuite: Fix T4442 on i386

Test Plan: Validate on i386

Reviewers: tdammers

Reviewed By: tdammers

Subscribers: rwbarton, thomie, carter

GHC Trac Issues: #15184

Differential Revision:

12 months agoUpdate user manual sections for -rtsopts and -with-rtsopts
Ömer Sinan Ağacan [Thu, 14 Jun 2018 13:12:57 +0000 (09:12 -0400)] 
Update user manual sections for -rtsopts and -with-rtsopts

- References to -rtsopts updated for the new ignore and ignoreAll

- Short description of -rtsopts updated. ignore and ignoreAll are now
  shown in the man page.

- Add a few clarifications about -rtsopts and -with-rtsopts interaction.

Reviewers: bgamari, AndreasK

Reviewed By: AndreasK

Subscribers: Phyx, rwbarton, thomie, carter

GHC Trac Issues: #15268

Differential Revision:

12 months agoDuplicated and
Gabor Greif [Fri, 8 Jun 2018 16:24:47 +0000 (18:24 +0200)] 
Duplicated and

12 months agotestsuite: Add Windows-specific output for T5611
Ben Gamari [Thu, 14 Jun 2018 13:09:56 +0000 (09:09 -0400)] 
testsuite: Add Windows-specific output for T5611

It's not entirely clear why this is necessary, but this currently fails
on Windows and the difference seems rather minor.

Test Plan: Validate on Windows

Reviewers: Phyx

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agotestsuite: Add -fghci-leak-check to expected output on mingw32
Ben Gamari [Thu, 14 Jun 2018 13:09:38 +0000 (09:09 -0400)] 
testsuite: Add -fghci-leak-check to expected output on mingw32

Test Plan: Validate on Windows

Subscribers: rwbarton, thomie, carter

Differential Revision:

12 months agolibiserv: Add license file
Ben Gamari [Thu, 14 Jun 2018 13:09:23 +0000 (09:09 -0400)] 
libiserv: Add license file

Test Plan: Run `make bindist` on built tree.

Subscribers: rwbarton, thomie, carter, angerman

GHC Trac Issues: #14392

Differential Revision: