purescript-contrib / purescript-bigints

Arbitrary length integers for PureScript
MIT License
26 stars 22 forks source link

Prim.Partial ? #44

Closed arkaitz-dev closed 2 years ago

arkaitz-dev commented 2 years ago

fromJust returns Prim.Partial, which is not a recognized type.

Example: fromJust (fromString "864854875498476985798759875076")

arkaitz-dev commented 2 years ago

I think I have found a solution to this issue (which happens when I try to use your example "y = (fromJust <<< fromBase 16) "fe45aab12" ").

In your example it can be solved this way: import Partial.Unsafe (unsafePartial) y = unsafePartial $ (fromJust <<< fromBase 16) "fe45aab12"

JordanMartinez commented 2 years ago

Yeah, Partial is a type class that indicates a function is not total (i.e. a runtime error could be produced on some inputs). You can only discharge that constraint using unsafePartial, which means you are opting into that behavior and telling the compiler "trust me."

Can this issue be closed?

arkaitz-dev commented 2 years ago

Hello! yes, of course, you can close it. Thank you!Arkaitz Dev @.> El sáb, 13 ago, 2022 a las 15:03, JordanMartinez @.> escribió:
Yeah, Partial is a type class that indicates a function is not total (i.e. a runtime error could be produced on some inputs). You can only discharge that constraint using unsafePartial, which means you are opting into that behavior and telling the compiler "trust me." Can this issue be closed?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>