[PATCH] (wip-haskell-updates) Add stylish-haskell.

  • Done
  • quality assurance status badge
Details
4 participants
  • John Soo
  • Ludovic Courtès
  • Robert Vollmert
  • Timothy Sample
Owner
unassigned
Submitted by
John Soo
Severity
normal

Debbugs page

John Soo wrote 6 years ago
(address . guix-patches@gnu.org)
CAKf5CqUKkNraDJ+TSENu5krn9gMwqQt3a3cKPpBF2_PkMaZ=ng@mail.gmail.com
Hi everyone,

Stylish haskell is a formatting tool for haskell code. It is the default
formatting option for the emacs haskell-mode. It is not the newest or the
best but it is good enough for me usually.

Thanks,

- John
Attachment: file
From 512eed6f9d3cc788c381378557d576e470600ca0 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 16 Aug 2019 07:18:30 -0700
Subject: [PATCH 1/2] gnu: Add ghc-file-embed.

* gnu/packages/haskell-xyz (ghc-file-embed): new file.
---
gnu/packages/haskell-xyz.scm | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)

Toggle diff (35 lines)
diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 90b85d8f43..2ddfec4bc4 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -11729,3 +11729,28 @@ provides access to the full zlib feature set.")
(description "This package provides low-level bindings to the
@code{zlib} package.")
(license license:bsd-3)))
+
+(define-public ghc-file-embed
+ (package
+ (name "ghc-file-embed")
+ (version "0.0.11")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "https://hackage.haskell.org/package/file-embed/"
+ "file-embed-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0l6dkwccbzzyx8rcav03lya2334dgi3vfwk96h7l93l0fc4x19gf"))))
+ (build-system haskell-build-system)
+ (home-page
+ "https://github.com/snoyberg/file-embed")
+ (synopsis
+ "Use Template Haskell to embed file contents directly.")
+ (description
+ "Use Template Haskell to read a file or all the files in a directory,
+and turn them into (path, bytestring) pairs embedded in your Haskell code.")
+ (license license:bsd-3)))
+
--
2.22.0
From fe5cbaeb2364d5d5debd629090d4a1fdd6f5939a Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 16 Aug 2019 07:20:28 -0700
Subject: [PATCH 2/2] gnu: Add stylish-haskell.

* gnu/packages/haskell-apps (stylish-haskell): new variable.
---
gnu/packages/haskell-apps.scm | 39 +++++++++++++++++++++++++++++++++++
1 file changed, 39 insertions(+)

Toggle diff (49 lines)
diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index edefd99e23..19a74a08e2 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -569,3 +569,42 @@ that cause a shell to behave strangely and counter-intuitively.
advanced user's otherwise working script to fail under future circumstances.
@end enumerate")
(license license:gpl3+)))
+
+(define-public stylish-haskell
+ (package
+ (name "stylish-haskell")
+ (version "0.9.2.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "https://hackage.haskell.org/package/stylish-haskell/"
+ "stylish-haskell-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1zs624xqp6j8vrl6pfv18dm8vz8hvz25grri65ximxhcizgwhnax"))))
+ (build-system haskell-build-system)
+ (inputs
+ `(("ghc-aeson" ,ghc-aeson)
+ ("ghc-file-embed" ,ghc-file-embed)
+ ("ghc-haskell-src-exts" ,ghc-haskell-src-exts)
+ ("ghc-semigroups" ,ghc-semigroups)
+ ("ghc-syb" ,ghc-syb)
+ ("ghc-yaml" ,ghc-yaml)
+ ("ghc-strict" ,ghc-strict)
+ ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+ ("ghc-hunit" ,ghc-hunit)
+ ("ghc-test-framework" ,ghc-test-framework)
+ ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)))
+ (home-page
+ "https://github.com/jaspervdj/stylish-haskell")
+ (synopsis "Haskell code prettifier")
+ (description
+ "A simple Haskell code prettifier. The goal is not to format all
+of the code in a file, since I find those kind of tools often
+\"get in the way\". However, manually cleaning up import statements
+etc. gets tedious very quickly.
+
+This tool tries to help where necessary without getting in the way.")
+ (license license:bsd-3)))
--
2.22.0
Ludovic Courtès wrote 6 years ago
(name . John Soo)(address . jsoo1@asu.edu)(address . 37052@debbugs.gnu.org)(name . Robert Vollmert)(address . rob@vllmrt.net)
874l21i86h.fsf@gnu.org
Hi John,

John Soo <jsoo1@asu.edu> skribis:

Toggle quote (7 lines)
> From 512eed6f9d3cc788c381378557d576e470600ca0 Mon Sep 17 00:00:00 2001
> From: John Soo <jsoo1@asu.edu>
> Date: Fri, 16 Aug 2019 07:18:30 -0700
> Subject: [PATCH 1/2] gnu: Add ghc-file-embed.
>
> * gnu/packages/haskell-xyz (ghc-file-embed): new file.

Please address the ‘guix lint’ warning.

Toggle quote (11 lines)
> + (package
> + (name "ghc-file-embed")
> + (version "0.0.11")
> + (source
> + (origin
> + (method url-fetch)
> + (uri
> + (string-append
> + "https://hackage.haskell.org/package/file-embed/"
> + "file-embed-" version ".tar.gz"))

I think Robert (Cc’d) aims make sure all the GHC packages come from the
same Stackage “snapshot”. Robert, could you tell whether this is the
case?

Also, please use mirror://hackage here.

Toggle quote (5 lines)
> + (home-page
> + "https://github.com/snoyberg/file-embed")
> + (synopsis
> + "Use Template Haskell to embed file contents directly.")

Better to keep each on a single line. :-)

Toggle quote (4 lines)
> + (description
> + "Use Template Haskell to read a file or all the files in a directory,
> +and turn them into (path, bytestring) pairs embedded in your Haskell code.")

Toggle quote (7 lines)
> From fe5cbaeb2364d5d5debd629090d4a1fdd6f5939a Mon Sep 17 00:00:00 2001
> From: John Soo <jsoo1@asu.edu>
> Date: Fri, 16 Aug 2019 07:20:28 -0700
> Subject: [PATCH 2/2] gnu: Add stylish-haskell.
>
> * gnu/packages/haskell-apps (stylish-haskell): new variable.

Same comments. :-)

Thanks,
Ludo’.
Timothy Sample wrote 6 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 37052@debbugs.gnu.org)(name . John Soo)(address . jsoo1@asu.edu)(name . Robert Vollmert)(address . rob@vllmrt.net)
874l20pzg8.fsf@ngyro.com
Hello,

Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (10 lines)
> John Soo <jsoo1@asu.edu> skribis:
>
>> + (package
>> + (name "ghc-file-embed")
>> + (version "0.0.11")
>
> I think Robert (Cc’d) aims make sure all the GHC packages come from the
> same Stackage “snapshot”. Robert, could you tell whether this is the
> case?

It’s too new. Right now we are following LTS 12, which has file-embed
at 0.0.10.1. The list is at https://www.stackage.org/lts-12.


-- Tim
Robert Vollmert wrote 6 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 37052@debbugs.gnu.org)(name . John Soo)(address . jsoo1@asu.edu)
C94DFB68-4B3D-4C23-83BE-FAD87A30222A@vllmrt.net
On 28. Aug 2019, at 18:08, Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (4 lines)
> I think Robert (Cc’d) aims make sure all the GHC packages come from the
> same Stackage “snapshot”. Robert, could you tell whether this is the
> case?

Sorry, I’m afraid I don’t really have plans here anymore / won’t be able
to take care of the Haskell packages.

Cheers
Robert
Ludovic Courtès wrote 6 years ago
Haskell package maintenance
(name . Robert Vollmert)(address . rob@vllmrt.net)(name . Ricardo Wurmus)(address . rekado@elephly.net)(address . 37052@debbugs.gnu.org)(name . John Soo)(address . jsoo1@asu.edu)
87k1awi1us.fsf_-_@gnu.org
Hi Robert,

Robert Vollmert <rob@vllmrt.net> skribis:

Toggle quote (8 lines)
> On 28. Aug 2019, at 18:08, Ludovic Courtès <ludo@gnu.org> wrote:
>> I think Robert (Cc’d) aims make sure all the GHC packages come from the
>> same Stackage “snapshot”. Robert, could you tell whether this is the
>> case?
>
> Sorry, I’m afraid I don’t really have plans here anymore / won’t be able
> to take care of the Haskell packages.

I’m sad to hear that, but thanks for letting us know.

I realize we committers have been lagging behind, and I’m afraid this
may have to do with your decision. :-/ If you have any suggestions on
how to improve our process, please let us know. It’s tough!

Ludo’.
John Soo wrote 6 years ago
Re: [bug#37052] [PATCH] (wip-haskell-updates) Add stylish-haskell.
(address . 37052@debbugs.gnu.org)(name . Ludovic Courtès)(address . ludo@gnu.org)
CAKf5CqWFWJyTWVigutgJHutrsMh+3pP2E_FYrk=a=9x6DmODZg@mail.gmail.com
HI Ludo and Timothy,

Thanks for the review.

Toggle quote (2 lines)
> Please address the ‘guix lint’ warning.

I fixed all the lint errors (and the offending commit message, woops!).

Toggle quote (2 lines)
> Better to keep each on a single line. :-)

I put them each on a single line, I like that better!

Toggle quote (1 lines)
> +and turn them into (path, bytestring) pairs embedded in your Haskell
code.")

I used @code{(path, bytestring)} for this tuple. Is that desired?

Toggle quote (3 lines)
> It’s too new. Right now we are following LTS 12, which has file-embed
> at 0.0.10.1.

I changed it to version 0.0.10.1.

Thanks again!

- John
Attachment: file
From 0292a434561076531007db8505c83e3425ef70a5 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 16 Aug 2019 07:18:30 -0700
Subject: [PATCH 1/2] gnu: Add ghc-file-embed.

* gnu/packages/haskell-xyz (ghc-file-embed): new variable.
---
gnu/packages/haskell-xyz.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 90b85d8f43..55afb22ebe 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -11729,3 +11729,26 @@ provides access to the full zlib feature set.")
(description "This package provides low-level bindings to the
@code{zlib} package.")
(license license:bsd-3)))
+
+(define-public ghc-file-embed
+ (package
+ (name "ghc-file-embed")
+ (version "0.0.10.1")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "mirror://hackage/package/file-embed/file-embed-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0lj164cnzqyd487mli91nnr7137a4h4qsasfwsnsh77sx12fpk9k"))))
+ (build-system haskell-build-system)
+ (home-page "https://github.com/snoyberg/file-embed")
+ (synopsis "Use Template Haskell to embed file contents directly")
+ (description
+ "Use Template Haskell to read a file or all the files in a directory,
+and turn them into @code{(path, bytestring)} pairs embedded in your Haskell
+code.")
+ (license license:bsd-3)))
+
--
2.22.0
From 2803dde3048cd10a982ca2d1a75d489924fec106 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Fri, 16 Aug 2019 07:20:28 -0700
Subject: [PATCH 2/2] gnu: Add stylish-haskell.

* gnu/packages/haskell-apps (stylish-haskell): new variable.
---
gnu/packages/haskell-apps.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)

Toggle diff (45 lines)
diff --git a/gnu/packages/haskell-apps.scm b/gnu/packages/haskell-apps.scm
index edefd99e23..41cce6f76d 100644
--- a/gnu/packages/haskell-apps.scm
+++ b/gnu/packages/haskell-apps.scm
@@ -569,3 +569,38 @@ that cause a shell to behave strangely and counter-intuitively.
advanced user's otherwise working script to fail under future circumstances.
@end enumerate")
(license license:gpl3+)))
+
+(define-public stylish-haskell
+ (package
+ (name "stylish-haskell")
+ (version "0.9.2.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append
+ "mirror://hackage/package/stylish-haskell/"
+ "stylish-haskell-" version ".tar.gz"))
+ (sha256
+ (base32
+ "1zs624xqp6j8vrl6pfv18dm8vz8hvz25grri65ximxhcizgwhnax"))))
+ (build-system haskell-build-system)
+ (inputs
+ `(("ghc-aeson" ,ghc-aeson)
+ ("ghc-file-embed" ,ghc-file-embed)
+ ("ghc-haskell-src-exts" ,ghc-haskell-src-exts)
+ ("ghc-semigroups" ,ghc-semigroups)
+ ("ghc-syb" ,ghc-syb)
+ ("ghc-yaml" ,ghc-yaml)
+ ("ghc-strict" ,ghc-strict)
+ ("ghc-optparse-applicative" ,ghc-optparse-applicative)
+ ("ghc-hunit" ,ghc-hunit)
+ ("ghc-test-framework" ,ghc-test-framework)
+ ("ghc-test-framework-hunit" ,ghc-test-framework-hunit)))
+ (home-page "https://github.com/jaspervdj/stylish-haskell")
+ (synopsis "Haskell code prettifier")
+ (description
+ "A simple Haskell code prettifier. The goal is not to format all of the
+code in a file, just clean up import statements and a few other tedious
+items. This tool tries to help where necessary without getting in the way.")
+ (license license:bsd-3)))
--
2.22.0
Ludovic Courtès wrote 6 years ago
(name . John Soo)(address . jsoo1@asu.edu)(address . 37052-done@debbugs.gnu.org)
87pnkj7ml8.fsf@gnu.org
Hi John,

John Soo <jsoo1@asu.edu> skribis:

Toggle quote (5 lines)
>> +and turn them into (path, bytestring) pairs embedded in your Haskell
> code.")
>
> I used @code{(path, bytestring)} for this tuple. Is that desired?

Yup!

Toggle quote (5 lines)
>> It’s too new. Right now we are following LTS 12, which has file-embed
>> at 0.0.10.1.
>
> I changed it to version 0.0.10.1.

Actually I just realized we already have ‘ghc-file-embed’…

Anyway, I’ve applied the ‘stylish-haskell’ patch now, thank you!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 37052@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 37052
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help