Re: [elm-discuss] Support for binary data
Our use case: Pure elm library for cryptographic functions. We are creating a pure Elm web3.js equivalent. We think Ethereum developers and the blockchain developer community at large would benefit from the strong guarantees of using Elm. Thanks On Monday, January 11, 2016 at 5:32:43 PM UTC-7, Evan wrote: > > I have been drafting Blob and ArrayBuffer APIs, but I wasn't sure who > needed them. > > What is your particular use case? > > On Mon, Jan 11, 2016 at 4:55 AM, John Watson> wrote: > >> Can anyone tell me what the plans are for supporting binary data in elm? >> I'm thinking of a Byte (and some sort of Byte Array) type and also >> implementing Blob in HTTP responses. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Elm Discuss" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to elm-discuss...@googlegroups.com . >> For more options, visit https://groups.google.com/d/optout. >> > > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[elm-discuss] Re: Is there an Elm window.print()?
Also to expand on why I used an empty tuple - Elm, from my understanding, will cache the call if it just returns a Bool, because it ends up looking like a constant. I don't know if, as a result, Elm will actually execute the function a second time, or if it will just return the boolean value from the first run of the call. The empty tuple forces elm to see this as a function rather than a constant, but it's a hack, and not a good practice. On Saturday, 8 July 2017 13:26:05 UTC-4, Marek Fajkus wrote: > > I agree with Alex in all his points - ports are a better way to achieve > this. Btw () (0-tuple) is unit type ( > https://en.wikipedia.org/wiki/Unit_type). *I'm saying that only so there > is any additional value in my comment other than +1 for Alex* > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[elm-discuss] Re: Is there an Elm window.print()?
I agree with Alex in all his points - ports are a better way to achieve this. Btw () (0-tuple) is unit type (https://en.wikipedia.org/wiki/Unit_type). *I'm saying that only so there is any additional value in my comment other than +1 for Alex* -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[elm-discuss] Re: Is there an Elm window.print()?
Is there a good reason *not* to use a port for this? The difficultly level is very low, and t's a single js function call. Also, don't even consider a native module at all. The general consensus is that native code isn't meant for the general Elm population, because it has the ability to absolutely break all guarantees that Elm initially promises. One main issue here is that Elm, being a functional language, needs a value returned after a function call. Sure, you could have something like `print : () -> Bool`, but that's not quite correct because you are adding extra meaningless data (ie passing a tuple and returning a bool, both unrelated to print). As a result, it's much better suited to be a Task (port function), since tasks don't return values, and there is no logical thing to return. >From personal experience, don't even consider native modules unless: 1. Elm does not have the ability to support the feature you want. 2. Sending a message to run a task makes performing the function awkward. 99% of the time for printing the screen, it's because the user is clicking a button on the page, and that's a super simple update from Elm. On Friday, 7 July 2017 03:39:40 UTC-4, Casper Bollen wrote: > > Is there an Elm way to implement window.print() without using a javascript > port? > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to elm-discuss+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.