[prev in list] [next in list] [prev in thread] [next in thread] 

List:       darcs-devel
Subject:    [darcs-devel] [patch1900] restrict the defaults for fromPrim/fromPrims
From:       Ganesh Sittampalam <bugs () darcs ! net>
Date:       2019-08-31 8:41:53
Message-ID: 1988479f-af39-86f0-da44-b3b0db4f074d () earth ! li
[Download RAW message or body]


Ganesh Sittampalam <ganesh@earth.li> added the comment:

>> Incidentally I was surprised to discover that we
>> were getting away without type instance PatchId for
>> both V1 and V2 patches, even though fromPrim
>> mentions them in its signature.
> 
> Yes, quite strange. I was wondering about that, but didn't investigate.
> I hope this is not some sort of defaulting.

I think it's because the type checker is happy to leave type family
applications unreduced if it doesn't have a rule for them. For something
like 'PatchId a' this makes sense as it doesn't know what 'a' is yet.
For things like 'PatchId (RepoPatchV1 prim)' it's a bit weird and often
it leaks into error messages that say "Can't unify PatchId (RepoPatchV1
prim) with Int" when really your mistake was just to not define the type
instance. In this case the argument is being ignored so probably it's
just getting unified with a free type variable which always succeeds.

__________________________________
Darcs bug tracker <bugs@darcs.net>
<http://bugs.darcs.net/patch1900>
__________________________________
_______________________________________________
darcs-devel mailing list
darcs-devel@osuosl.org
https://lists.osuosl.org/mailman/listinfo/darcs-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic