From patchwork Thu Jun 3 15:58:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 29873 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 46EF327BC81; Thu, 3 Jun 2021 16:59:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D41A227BC78 for ; Thu, 3 Jun 2021 16:59:32 +0100 (BST) Received: from localhost ([::1]:50596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lopkp-0000Ce-RK for patchwork@mira.cbaines.net; Thu, 03 Jun 2021 11:59:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lopkP-0007N9-0Y for guix-patches@gnu.org; Thu, 03 Jun 2021 11:59:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:33043) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lopkO-0006h0-P7 for guix-patches@gnu.org; Thu, 03 Jun 2021 11:59:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lopkO-0001xW-OO for guix-patches@gnu.org; Thu, 03 Jun 2021 11:59:04 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48813] [PATCH 8/8] gnu: Add ghc-brittany. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 03 Jun 2021 15:59:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48813 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48813@debbugs.gnu.org Received: via spool by 48813-submit@debbugs.gnu.org id=B48813.16227359117441 (code B ref 48813); Thu, 03 Jun 2021 15:59:04 +0000 Received: (at 48813) by debbugs.gnu.org; 3 Jun 2021 15:58:31 +0000 Received: from localhost ([127.0.0.1]:44582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lopjr-0001vs-1w for submit@debbugs.gnu.org; Thu, 03 Jun 2021 11:58:31 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:53402 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lopje-0001ui-Iy for 48813@debbugs.gnu.org; Thu, 03 Jun 2021 11:58:19 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1622735893; bh=1dBq9ktei3ob7q8kjCz79qfcbnrLJM2Df9lD7JfmEvY=; h=From:To:Subject:In-Reply-To:References:Date; b=GSAv9oBDWZ6t38NtusOUpXxUnuTki5Rvaw0j1YYeePmm45apZganKFHJORh1kjjIP p2UmJ0udfcs9QLsBO9isginJAbUkoK5CbLkI1GsFoJ1cLC7hA4R1brLDZuCzV+cDEO 4DbW9Z3CM8A4Vl2j+6rRRsiqu+a9ebDx7RkcTKL0= In-Reply-To: References: Message-Id: <49eb8fd90d7b7d285b0d9f6b2d7e99c8a6628570.1622735640.git.public@yoctocell.xyz> Date: Thu, 03 Jun 2021 17:58:12 +0200 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * gnu/packages/haskell-xyz.scm (ghc-brittany): New variable. --- gnu/packages/haskell-xyz.scm | 126 +++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm index 446e60477b..ee54a65332 100644 --- a/gnu/packages/haskell-xyz.scm +++ b/gnu/packages/haskell-xyz.scm @@ -1211,6 +1211,132 @@ interface.") using a simple box model.") (license license:bsd-3))) +(define-public ghc-brittany + (package + (name "ghc-brittany") + (version "0.12.1.1") + (source + (origin + (method url-fetch) + (uri (string-append + "https://hackage.haskell.org/package/brittany/brittany-" + version + ".tar.gz")) + (sha256 + (base32 + "0nw7ymdb7xam634w42l1xjgyvpla8grcg02aj19fscw2fn9gfh7z")))) + (build-system haskell-build-system) + (inputs + `(("ghc-paths" ,ghc-paths) + ("ghc-exactprint" ,ghc-exactprint) + ("ghc-multistate" ,ghc-multistate) + ("ghc-syb" ,ghc-syb) + ("ghc-neat-interpolation" + ,ghc-neat-interpolation) + ("ghc-data-tree-print" ,ghc-data-tree-print) + ("ghc-butcher" ,ghc-butcher) + ("ghc-yaml" ,ghc-yaml) + ("ghc-aeson" ,ghc-aeson) + ("ghc-extra" ,ghc-extra) + ("ghc-uniplate" ,ghc-uniplate) + ("ghc-strict" ,ghc-strict) + ("ghc-monad-memo" ,ghc-monad-memo) + ("ghc-unsafe" ,ghc-unsafe) + ("ghc-safe" ,ghc-safe) + ("ghc-semigroups" ,ghc-semigroups) + ("ghc-cmdargs" ,ghc-cmdargs) + ("ghc-czipwith" ,ghc-czipwith) + ("ghc-random" ,ghc-random))) + (native-inputs + `(("ghc-hspec" ,ghc-hspec) + ("ghc-hspec" ,ghc-hspec) + ("ghc-hspec" ,ghc-hspec))) + (arguments + `(#:cabal-revision + ("2" + "0pfrm5vvh7x94f8gy8ka6rmq6yk6xxxgba68rd91bk8lbjxsmkxl"))) + (home-page "https://github.com/lspitzner/brittany/") + (synopsis "Haskell source code formatter") + (description "Brittany is a Haskell source code formatter. The goal of +this project is to: + +@itemize +@item +Always retain the semantics of the source being transformed; +@item +Be idempotent; +@item +Support the full GHC-haskell syntax including syntactic extensions (but +excluding -XCPP which is too hard); +@item +Retain newlines and comments unmodified; +@item +Be clever about using the available horizontal space while not overflowing the +column maximum unless it cannot be avoided; +@item +Be clever about aligning things horizontally (this can be turned off +completely however); +@item +Have linear complexity in the size of the input. +@end itemize") + (license license:agpl3))) + +(define-public ghc-butcher + (package + (name "ghc-butcher") + (version "1.3.2.3") + (source + (origin + (method url-fetch) + (uri (string-append + "https://hackage.haskell.org/package/butcher/butcher-" + version + ".tar.gz")) + (sha256 + (base32 + "0lpicayq9k59m2ydz989xsypr653xwhp6mmhlp7nmjzk6jwpq5q5")))) + (build-system haskell-build-system) + (inputs + `(("ghc-free" ,ghc-free) + ("ghc-unsafe" ,ghc-unsafe) + ("ghc-microlens" ,ghc-microlens) + ("ghc-microlens-th" ,ghc-microlens-th) + ("ghc-multistate" ,ghc-multistate) + ("ghc-extra" ,ghc-extra) + ("ghc-void" ,ghc-void) + ("ghc-bifunctors" ,ghc-bifunctors) + ("ghc-deque" ,ghc-deque))) + (native-inputs `(("ghc-hspec" ,ghc-hspec))) + (arguments + `(#:cabal-revision + ("2" + "1751sllw8s81x3s1dhilbr5lqnv9cpdqiv17c8by466aa6304dxa"))) + (home-page "https://github.com/lspitzner/butcher/") + (synopsis "Chops a command or program invocation into digestable pieces.") + (description "This package is similar to the optparse-applicative package, +but less features, more flexibility and more evil. + +The main differences are: + +@itemize +@item Provides a pure interface by default + +@item Exposes an evil monadic interface, which allows for much nicer binding +of command part results to some variable name. + +In optparse-applicative you easily lose track of what field you are modifying +after the 5th <*> (admittedly, i think -XRecordWildCards improves on that +issue already.) + +Evil, because you are not allowed to use the monad's full power in this case, +i.e. there is a constraint that is not statically enforced. See below. + +@item The monadic interface allows much clearer definitions of commandparses +with (nested) subcommands. No pesky sum-types are necessary. +@end itemize") + + (license license:bsd-3))) + (define-public ghc-byteable (package (name "ghc-byteable")