Open german1608 opened 4 years ago
@german1608: There is not. The closest thing you can do is something like:
$ dhall "List/length SomeType $(json-to-dhall --file sample.json)"
Generally, the right solution to this problem is to provide language support for importing JSON into Dhall
@german1608, don't know if you're still interested, but use this a lot, but I have my own implementation dhall --aply
from your example. With the implementation I'm using, your example would look like:
json-to-dhall --file sample.json | dhall-filter 'List/length input'
Where input : Input
is parsed standard input exposed as two variables, one is the value (input
) and the other is its type (Input
). I wouldn't mind reimplementing it as part dhall-haskell
, if there's wider interest.
I have a large JSON list in a file, and I wanted to use
json-to-dhall
output to get the length using a oneliner without . Is there a subcommand in thedhall
executable that receives a Dhall function as a flag, another Dhall expression via STDIN or file and outputs the result of applying the function to that expression?An example could be more descriptive: