From 791789d3ea2f651be56b4e18d35bf036c84191ac Mon Sep 17 00:00:00 2001 From: bluesky0906 <9bluesky6@gmail.com> Date: Sun, 31 Aug 2025 21:58:46 +0900 Subject: [PATCH 1/2] Use hasktorch on hackage --- hasktorch-tools.cabal | 120 +++++------------------------------------- package.yaml | 42 +++++++-------- stack.yaml | 34 ++---------- 3 files changed, 38 insertions(+), 158 deletions(-) diff --git a/hasktorch-tools.cabal b/hasktorch-tools.cabal index d5fb5c2..6cecdb7 100644 --- a/hasktorch-tools.cabal +++ b/hasktorch-tools.cabal @@ -1,10 +1,10 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.1. +-- This file has been generated from package.yaml by hpack version 0.38.1. -- -- see: https://github.com/sol/hpack -- --- hash: add34cc83dbafac32c97172bdc06927ade56c1ca5a70c327bed3dc5ad827e9a9 +-- hash: b29e6357fe6c4de727051845a6dd2aa7738012f72b4cb9e17e9a8dbaf70192a6 name: hasktorch-tools version: 0.2.0.7 @@ -56,35 +56,19 @@ library RecordWildCards ghc-options: -Wall build-depends: - JuicyPixels - , aeson >=1.0 - , async - , base >=4.7 && <5 + aeson >=1.0 + , base >=4.14 && <5 , bytestring >=0.10 , cereal >=0.5 , cereal-text >=0.1 - , codegen , directory >=1.3 , filepath >=1.4 - , finite-typelits - , ghc-typelits-extra - , ghc-typelits-knownnat - , ghc-typelits-natnormalise , hasktorch >=0.2 , json-stream >=0.4 - , libtorch-ffi - , libtorch-ffi-helper - , mtl , nlp-tools >=0.1.9 - , reflection - , safe-exceptions , shelly >=1.6 - , singletons - , stm , text >=1.2 - , vector , yaml >=0.8.3 - , zlib >=0.6 default-language: Haskell2010 executable first-tensor @@ -95,36 +79,20 @@ executable first-tensor app/first-tensor ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: - JuicyPixels - , aeson >=1.0 - , async - , base >=4.7 && <5 + aeson >=1.0 + , base >=4.14 && <5 , bytestring >=0.10 , cereal >=0.5 , cereal-text >=0.1 - , codegen , directory >=1.3 , filepath >=1.4 - , finite-typelits - , ghc-typelits-extra - , ghc-typelits-knownnat - , ghc-typelits-natnormalise , hasktorch >=0.2 , hasktorch-tools , json-stream >=0.4 - , libtorch-ffi - , libtorch-ffi-helper - , mtl , nlp-tools >=0.1.9 - , reflection - , safe-exceptions , shelly >=1.6 - , singletons - , stm , text >=1.2 - , vector , yaml >=0.8.3 - , zlib >=0.6 default-language: Haskell2010 executable lstmSample @@ -135,36 +103,20 @@ executable lstmSample app/lstmSample ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: - JuicyPixels - , aeson >=1.0 - , async - , base >=4.7 && <5 + aeson >=1.0 + , base >=4.14 && <5 , bytestring >=0.10 , cereal >=0.5 , cereal-text >=0.1 - , codegen , directory >=1.3 , filepath >=1.4 - , finite-typelits - , ghc-typelits-extra - , ghc-typelits-knownnat - , ghc-typelits-natnormalise , hasktorch >=0.2 , hasktorch-tools , json-stream >=0.4 - , libtorch-ffi - , libtorch-ffi-helper - , mtl , nlp-tools >=0.1.9 - , reflection - , safe-exceptions , shelly >=1.6 - , singletons - , stm , text >=1.2 - , vector , yaml >=0.8.3 - , zlib >=0.6 default-language: Haskell2010 executable xor-mlp @@ -175,36 +127,20 @@ executable xor-mlp app/xor-mlp ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: - JuicyPixels - , aeson >=1.0 - , async - , base >=4.7 && <5 + aeson >=1.0 + , base >=4.14 && <5 , bytestring >=0.10 , cereal >=0.5 , cereal-text >=0.1 - , codegen , directory >=1.3 , filepath >=1.4 - , finite-typelits - , ghc-typelits-extra - , ghc-typelits-knownnat - , ghc-typelits-natnormalise , hasktorch >=0.2 , hasktorch-tools , json-stream >=0.4 - , libtorch-ffi - , libtorch-ffi-helper - , mtl , nlp-tools >=0.1.9 - , reflection - , safe-exceptions , shelly >=1.6 - , singletons - , stm , text >=1.2 - , vector , yaml >=0.8.3 - , zlib >=0.6 default-language: Haskell2010 test-suite lstmTest @@ -217,36 +153,20 @@ test-suite lstmTest ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: HUnit >=1.6.0 - , JuicyPixels , aeson >=1.0 - , async - , base >=4.7 && <5 + , base >=4.14 && <5 , bytestring >=0.10 , cereal >=0.5 , cereal-text >=0.1 - , codegen , directory >=1.3 , filepath >=1.4 - , finite-typelits - , ghc-typelits-extra - , ghc-typelits-knownnat - , ghc-typelits-natnormalise , hasktorch >=0.2 , hasktorch-tools , json-stream >=0.4 - , libtorch-ffi - , libtorch-ffi-helper - , mtl , nlp-tools >=0.1.9 - , reflection - , safe-exceptions , shelly >=1.6 - , singletons - , stm , text >=1.2 - , vector , yaml >=0.8.3 - , zlib >=0.6 default-language: Haskell2010 test-suite rnnTest @@ -259,34 +179,18 @@ test-suite rnnTest ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N build-depends: HUnit >=1.6.0 - , JuicyPixels , aeson >=1.0 - , async - , base >=4.7 && <5 + , base >=4.14 && <5 , bytestring >=0.10 , cereal >=0.5 , cereal-text >=0.1 - , codegen , directory >=1.3 , filepath >=1.4 - , finite-typelits - , ghc-typelits-extra - , ghc-typelits-knownnat - , ghc-typelits-natnormalise , hasktorch >=0.2 , hasktorch-tools , json-stream >=0.4 - , libtorch-ffi - , libtorch-ffi-helper - , mtl , nlp-tools >=0.1.9 - , reflection - , safe-exceptions , shelly >=1.6 - , singletons - , stm , text >=1.2 - , vector , yaml >=0.8.3 - , zlib >=0.6 default-language: Haskell2010 diff --git a/package.yaml b/package.yaml index 4aa94eb..faa8046 100644 --- a/package.yaml +++ b/package.yaml @@ -17,27 +17,27 @@ dependencies: # for hasktorch - base >= 4.14 && < 5 - hasktorch >= 0.2 -- libtorch-ffi -- libtorch-ffi-helper -- codegen -- async -- finite-typelits -- ghc-typelits-extra >= 0.3.1 -- ghc-typelits-knownnat >= 0.7 -- ghc-typelits-natnormalise >= 0.7 -- ghc-typelits-extra -- ghc-typelits-knownnat -- ghc-typelits-natnormalise -- mtl -- safe-exceptions -- reflection -- singletons -- stm -- JuicyPixels -- vector -- bytestring -- safe-exceptions -- zlib >= 0.6 +# - libtorch-ffi +# - libtorch-ffi-helper +# - codegen +# - async +# - finite-typelits +# - ghc-typelits-extra >= 0.3.1 +# - ghc-typelits-knownnat >= 0.7 +# - ghc-typelits-natnormalise >= 0.7 +# - ghc-typelits-extra +# - ghc-typelits-knownnat +# - ghc-typelits-natnormalise +# - mtl +# - safe-exceptions +# - reflection +# - singletons +# - stm +# - JuicyPixels +# - vector +# - bytestring +# - safe-exceptions +# - zlib >= 0.6 # for hasktorch-tools - text >= 1.2 - filepath >= 1.4 diff --git a/stack.yaml b/stack.yaml index 08cef89..9c0a2e1 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,40 +1,16 @@ -resolver: lts-20.26 +resolver: lts-22.43 flags: {} -extra-include-dirs: - - /deps/libtorch/include/torch/csrc/api/include - - /deps/libtorch/include - -extra-lib-dirs: - - /deps/libtorch/lib - - /deps/mklml/lib - - /deps/libtokenizers/lib - extra-deps: - - /codegen - - /libtorch-ffi - - /libtorch-ffi-helper - - /hasktorch - - datasets-0.4.0@sha256:9bfd5b54c6c5e1e72384a890cf29bf85a02007e0a31c98753f7d225be3c7fa6a,4929 - - require-0.4.10@sha256:41b096daaca0d6be49239add1149af9f34c84640d09a7ffa9b45c55f089b5dac,3759 - - indexed-extras-0.2@sha256:e7e498023e33016fe45467dfee3c1379862e7e6654a806a965958fa1adc00304,1349 - - normaldistribution-1.1.0.3@sha256:2615b784c4112cbf6ffa0e2b55b76790290a9b9dff18a05d8c89aa374b213477,2160 - - term-rewriting-0.4.0.2@sha256:5412f6aa29c5756634ee30e8df923c83ab9f012a4b8797c460af3d7078466764,2740 - - git: https://github.com/hasktorch/tintin - commit: 0d5afba586da01e0a54e598745676c5c56189178 - - git: https://github.com/hasktorch/tokenizers - commit: 9d25f0ba303193e97f8b22b9c93cbc84725886c3 - subdirs: - - bindings/haskell/tokenizers-haskell + - hasktorch-0.2.1.6@sha256:96533610cc75d0cdf8502be8dfca7980181c8c8f5e24958e71c75c2d81ad643c,10919 + - libtorch-ffi-2.0.1.8@sha256:05f0f62336e5a1c1177b051d48ce25642af05ffe8b496a4e5152ac26486f4f0d,10072 + - libtorch-ffi-helper-2.0.0.2@sha256:736af4aa52c88c3e91de9372b81a1b7b90c0223838871d4017ee093f6729c287,904 + - streaming-cassava-0.2.0.0@sha256:aea99400ef6e7fa064bb275601503544608b8e3fbee6f6c661b019033dc40d11,1812 - git: https://github.com/hasktorch/typelevel-rewrite-rules commit: 4176e10d4de2d1310506c0fcf6a74956d81d59b6 - git: https://github.com/hasktorch/type-errors-pretty commit: 32d7abec6a21c42a5f960d7f4133d604e8be79ec - - union-find-array-0.1.0.3@sha256:242e066ec516d61f262947e5794edc7bbc11fd538a0415c03ac0c01b028cfa8a,1372 - - clay-0.14.0@sha256:382eced24317f9ed0f7a0a4789cdfc6fc8dd32895cdb0c4ea50a1613bee08af3,2128 - - inline-c-0.9.1.10 - - inline-c-cpp-0.5.0.2 - git: http://github.com/DaisukeBekki/nlp-tools.git commit: 0b6912850dbffd14ed16c3fa26a0773c877ba093 From e0c2af7873824c0ff07295a5e3adbcc3206a0a03 Mon Sep 17 00:00:00 2001 From: bluesky0906 <9bluesky6@gmail.com> Date: Sun, 31 Aug 2025 23:57:09 +0900 Subject: [PATCH 2/2] Remove unnecessary comments from package.yaml --- package.yaml | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/package.yaml b/package.yaml index faa8046..55350e8 100644 --- a/package.yaml +++ b/package.yaml @@ -14,30 +14,8 @@ extra-source-files: description: https://github.com/DaisukeBekki/hasktorch-tools#readme dependencies: -# for hasktorch - base >= 4.14 && < 5 - hasktorch >= 0.2 -# - libtorch-ffi -# - libtorch-ffi-helper -# - codegen -# - async -# - finite-typelits -# - ghc-typelits-extra >= 0.3.1 -# - ghc-typelits-knownnat >= 0.7 -# - ghc-typelits-natnormalise >= 0.7 -# - ghc-typelits-extra -# - ghc-typelits-knownnat -# - ghc-typelits-natnormalise -# - mtl -# - safe-exceptions -# - reflection -# - singletons -# - stm -# - JuicyPixels -# - vector -# - bytestring -# - safe-exceptions -# - zlib >= 0.6 # for hasktorch-tools - text >= 1.2 - filepath >= 1.4