News for hackers. Stuff that matters.
Re:Go Enums Suck by yhavr on Saturday March 02, 2024 @10:35AM (#39573206)
Btw, tried to implement Result[T] flatmaps etc, it looks uglier than err != nil

func myfunc(url string) Result[string] {

  tup := FromTuplePtr(http.Get(url))

  return FlatMap(tup, func(r http.Response) Result[string] {

    return Map(FromTuple(io.ReadAll(r.Body)), func(b []byte) string {

      return string(b)

    })

  })

}

There are no comments on this comment yet.