On Saturday, January 31, 2015 22:59:21 [email protected] 
wrote:
> Send nix-dev mailing list submissions to
>       [email protected]
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>       http://lists.science.uu.nl/mailman/listinfo/nix-dev
> or, via email, send a message with subject or body 'help' to
>       [email protected]
> 
> You can reach the person managing the list at
>       [email protected]
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of nix-dev digest..."
> 
> 
> Today's Topics:
> 
>    1. Re: overriding a package (Catonano)
>    2. Re: overriding a package (Bj?rn Forsman)
>    3. Re: overriding a package (Catonano)
>    4. Check the priority of package in the nix store (Richard Wallace)
>    5. Re: Use Haskell for Shell Scripting (Shea Levy)
>    6. Re: Use Haskell for Shell Scripting (Ertugrul S?ylemez)
>    7. Re: Use Haskell for Shell Scripting (Tim Barbour)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Sat, 31 Jan 2015 18:29:06 +0100
> From: Catonano <[email protected]>
> Subject: Re: [Nix-dev] overriding a package
> To: Bj?rn Forsman <[email protected]>
> Cc: Nix Dev <[email protected]>
> Message-ID:
>       <caj98pdymfgcyhcdsf5ojrvwgdcv3eorjuovx5pxwamdxssx...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> 2015-01-31 16:50 GMT+01:00 Bj?rn Forsman <[email protected]>:
> > That's weird. I copy/pasted your code into my ~/.nixpkgs/config.nix
> > and it worked just fine.
> 
> I removed it and reinstalled it again.
> 
> Now the sympthom is different
> 
> $ nix-env -i InfTaRacket
> error: selector ?InfTaRacket? matches no derivations
> 
> $ nix-env -i myRacket
> error: selector ?myRacket? matches no derivations
> 
> $ nix-env -qa racket
> racket-6.1.1
> racket-6.1.1
> 
> 
> BUT if I decomment the line
> 
> #name = "${pname}-${version}";
> 
> then this is the result
> 
> $ nix-env -qa racket
> error: undefined variable ?pname? at "/home/me/.nixpkgs/config.nix":9:16
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150131/a3b5e505/
> attachment-0001.html
> 
> ------------------------------
> 
> Message: 2
> Date: Sat, 31 Jan 2015 19:13:45 +0100
> From: Bj?rn Forsman <[email protected]>
> Subject: Re: [Nix-dev] overriding a package
> To: Catonano <[email protected]>
> Cc: Nix Dev <[email protected]>
> Message-ID:
>       <CAEYzJUGy+tuf7etdgoag7E1jyKo+owrD3pNA5zRfY9N=nxb...@mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
> 
> On 31 January 2015 at 18:29, Catonano <[email protected]> wrote:
> > 2015-01-31 16:50 GMT+01:00 Bj?rn Forsman <[email protected]>:
> >> That's weird. I copy/pasted your code into my ~/.nixpkgs/config.nix
> >> and it worked just fine.
> > 
> > I removed it and reinstalled it again.
> > 
> > Now the sympthom is different
> > 
> > $ nix-env -i InfTaRacket
> > error: selector ?InfTaRacket? matches no derivations
> > 
> > $ nix-env -i myRacket
> > error: selector ?myRacket? matches no derivations
> > 
> > $ nix-env -qa racket
> > racket-6.1.1
> > racket-6.1.1
> > 
> > 
> > BUT if I decomment the line
> > 
> > #name = "${pname}-${version}";
> > 
> > then this is the result
> > 
> > $ nix-env -qa racket
> > error: undefined variable ?pname? at "/home/me/.nixpkgs/config.nix":9:16
> 
> To enable attributes to refer to each other, within the same attrset,
> you need to put 'rec' in front of the attrset. In other words, instead
> of "oldAttrs: {", use "oldAttrs: rec {".
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Sat, 31 Jan 2015 19:27:30 +0100
> From: Catonano <[email protected]>
> Subject: Re: [Nix-dev] overriding a package
> To: Bj?rn Forsman <[email protected]>
> Cc: Nix Dev <[email protected]>
> Message-ID:
>       <caj98pdywr9vr0xsvjgkak96zq+nrobkpx3vdburslzj9r-e...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> 2015-01-31 19:13 GMT+01:00 Bj?rn Forsman <[email protected]>:
> 
> To enable attributes to refer to each other, within the same attrset,
> 
> > you need to put 'rec' in front of the attrset. In other words, instead
> > of "oldAttrs: {", use "oldAttrs: rec {".
> 
> Thank you
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150131/6844d62f/
> attachment-0001.html
> 
> ------------------------------
> 
> Message: 4
> Date: Sat, 31 Jan 2015 13:19:58 -0700
> From: Richard Wallace <[email protected]>
> Subject: [Nix-dev] Check the priority of package in the nix store
> To: nix-dev <[email protected]>
> Message-ID:
>       <CAGgpxwm3CZ8DGrjhK0=agyhlvofook9frw3qlyp03g6twae...@mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
> 
> Hey folks,
> 
> I'm running into some issues with packages conflicting and the priority
> seeming to be ignored. I reported it last night thinking it was a problem
> with Haskell NG but now think it is something different.
> 
> I'm using nix-build to build it locally, copy-nix-closure to copy it to the
> machine I want to run it on, and on that remote machine run `nix-env -i`.
> 
> In the derivation for the package I've used the `hiPrio` function to make
> this new package a higher priority.  When I use the nix-repl and import and
> check the value, I can see that the meta.priority is indeed set to -10 as
> it should be.  But when `nix-env -i` is run it still complains about the
> conflict.
> 
> Is there a way to check the priority of something in the nix-store? Any
> ideas why the priority is being ignored and/or lost in this process? Am
> there something wrong in my process?
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150131/cb913c27/
> attachment-0001.html
> 
> ------------------------------
> 
> Message: 5
> Date: Sat, 31 Jan 2015 20:51:37 +0000
> From: Shea Levy <[email protected]>
> Subject: Re: [Nix-dev] Use Haskell for Shell Scripting
> To: Daniel Peebles <[email protected]>
> Cc: nix-dev <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=utf-8
> 
> Yes, I?m planning to work on multiple outputs for ghc soon :)
> 
> > On Jan 31, 2015, at 3:55 PM, Daniel Peebles <[email protected]> wrote:
> > 
> > Yeah, was kidding around!
> > 
> > On Jan 31, 2015, at 10:47, Ertugrul S?ylemez <[email protected]> wrote:
> >>> If only we had a way to produce multiple outputs from a single
> >>> package... :)
> >> 
> >> We have.  The `derivation` function supports producing multiple outputs,
> >> and I'm sure that `mkDerivation` forwards this ability.
> >> 
> >> 
> >> Greets,
> >> Ertugrul
> > 
> > _______________________________________________
> > nix-dev mailing list
> > [email protected]
> > http://lists.science.uu.nl/mailman/listinfo/nix-dev
> 
> ------------------------------
> 
> Message: 6
> Date: Sat, 31 Jan 2015 22:03:50 +0100
> From: Ertugrul S?ylemez <[email protected]>
> Subject: Re: [Nix-dev] Use Haskell for Shell Scripting
> To: Shea Levy <[email protected]>, Daniel Peebles
>       <[email protected]>
> Cc: nix-dev <[email protected]>
> Message-ID: <[email protected]_W_723V_1_36_000>
> Content-Type: text/plain; charset="utf-8"
> 
> > Yes, I?m planning to work on multiple outputs for ghc soon :)
> 
> Great!  I'm looking forward to that. =)
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 472 bytes
> Desc: not available
> Url :
> http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150131/30b8da8f/
> attachment-0001.bin
> 
> ------------------------------
> 
> Message: 7
> Date: Sun, 01 Feb 2015 08:59:13 +1100
> From: Tim Barbour <[email protected]>
> Subject: Re: [Nix-dev] Use Haskell for Shell Scripting
> To: Ertugrul S?ylemez <[email protected]>
> Cc: nix-dev <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> At Sat, 31 Jan 2015 13:22:09 +0100,
> 
> Ertugrul S?ylemez wrote:
> > [...]
> > I have actually experimented with using Haskell (and a few other FP
> > languages) as a substitute for shells.
> > [...]
> > You might be interested why Curry didn't work.  Simple: I couldn't figure
> > out how to write a program.  Actually I went through the whole tutorial,
> > did all the exercises (they aren't really difficult to a Haskell
> > programmer) and then skimmed through the whole PAKCS manual.  I could
> > write extremely elegant algorithmic code and was quite amazed at the
> > beauty of this language, even compared to Haskell.  But in the end I
> > still didn't know how to turn all this beautiful Curry code into an
> > executable file that I can run without invoking PAKCS explicitly. 
> > Something with a shebang or ideally something binary.  It would probably
> > be possible to write wrapper scripts, but let's just wait until one of
> > the implementations becomes mature enough for systems programming.
> 
> Curry is indeed a beautiful language, and is essentially a conservative
> extension of Haskell. I am surprised that more Haskell folk have not adopted
> it.
> 
> PAKCS compiles Curry to Prolog (typically SICStus), which drags in the
> Prolog system. To get a binary executable, a better choice would be MCC
> (compiles Curry to native code) or KiCS2 (compiles Curry to Haskell, which
> can go into ghc):
> 
>    http://www-ps.informatik.uni-kiel.de/currywiki/implementations/overview
> 
> Tim
> 

The nixpkgs expression for PAKCS uses SWI prolog, and PAKCS has an option for 
producing a wrapper that calls swi to execute your program.  With this you can 
use PAKCS for "scripting" in more or less the same way as perl, php, bash, 
python, nodejs etc

For example:

[kkallio@eka:scratch]$ cat hello.curry
main :: IO ()
main = putStrLn "Hello world!"

[kkallio@eka:scratch]$ pakcs :load hello :save :quit
[1 of 2] Skipping  Prelude          ( 
/nix/store/9rbmp69y6mc578y7iwan8ywn51lf77iz-
pakcs-1.11.4/pakcs/lib/Prelude.curry, 
/nix/store/9rbmp69y6mc578y7iwan8ywn51lf77iz-
pakcs-1.11.4/pakcs/lib/.curry/Prelude.fcy )
[2 of 2] Skipping  hello            ( hello.curry, .curry/hello.fcy )
Executable saved in: hello

[kkallio@eka:scratch]$ ./hello 
Hello world!

[kkallio@eka:scratch]$ 



the produced file "hello" is a bash script which will exec SWI prolog.


_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to