unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.68k stars 266 forks source link

Type signatures render differently for find vs view #2546

Open ceedubs opened 2 years ago

ceedubs commented 2 years ago

I was surprised to see type signatures rendering differently for the same terms depending on whether they were a find result or a view result. If I'm honest I don't really understand the g1 and g that are showing up in the find output, since they don't show up in the inputs at all.

find results

mynamespace> find tryFrom

  1. tryFromFile : ∀ r g1 g.
                     FilePath
                     ->{IO, Exception} Either
                       (trunk.Error () JsonToken) (base.Request {JsonRead} r ->{g1, g} r)
  2. tryFromText : ∀ r g1 g.
                     Text
                     ->{Exception} Either
                       (trunk.Error () JsonToken) (base.Request {JsonRead} r ->{g1, g} r)

view results

mynamespace> view 1 2

  tryFromFile :
    FilePath ->{IO, Exception} Either (trunk.Error () JsonToken) (base.Request {JsonRead} r -> r)
  tryFromFile path =
    match Json.tryFromFile path with
      Right json -> Right (handler json)
      Left e     -> Left e

  tryFromText : Text -> Either (trunk.Error () JsonToken) (base.Request {JsonRead} r -> r)
  tryFromText text =
    match Json.tryFromText text with
      Left e     -> raise (errorToFailure e)
      Right json -> Right (handler json)
aryairani commented 2 weeks ago

Output today (0.5.23):

nice-walrus/main> view .cloud.proj1.lib.cloud.lib.json.JsonRead.tryFromFile#gpir3nghsmif9mfmkqqee8ccovvucsapof0co5lfo5afcuk935art500c2j03brb4q4li1gqqogjsl8m60oukkrf0poo8sd0aeihjog .cloud.proj1.lib.cloud.lib.json.JsonRead.tryFromText#89oq0pif992tn3qki0c0ta2sllpp2r1mnff0bjoord1avhiikm9ka189eqaulftdu7pp70pphs1c8kj4cf453thevktffldqac96r6o

  .cloud.proj1.lib.cloud.lib.json.JsonRead.tryFromFile :
    FilePath
    ->{base.IO, base.Exception} Either
      (parser.Error () json.parser.tokenizer.JsonToken)
      (base.Request {json.JsonRead} r ->{g, g1} r)
  .cloud.proj1.lib.cloud.lib.json.JsonRead.tryFromFile path =
    match json.Json.tryFromFile path with
      Either.Right json -> Either.Right (json.JsonRead.handler json)
      Either.Left e     -> Either.Left e

  .cloud.proj1.lib.cloud.lib.json.JsonRead.tryFromText :
    Text
    ->{base.Exception} Either
      (parser.Error () json.parser.tokenizer.JsonToken)
      (base.Request {json.JsonRead} r ->{g, g1} r)
  .cloud.proj1.lib.cloud.lib.json.JsonRead.tryFromText text =
    match json.Json.tryFromText text with
      Either.Left e     -> abilities.Exception.raise (json.Json.errorToFailure e)
      Either.Right json -> Either.Right (json.JsonRead.handler json)

Looks like the same as find for these old definitions, but unfortunately it is showing {g, g1} in both spots now.