Code Monkey home page Code Monkey logo

haskell-yesod-weight-record-app's Introduction

weight-recorder

プロジェクト作成

stack build

Sqliteの疎通

$ ghci
import GHCi, version 8.10.7: https://www.haskell.org/ghc/  :? for help
DPrelude> import Database.HDBC.Sqlite3
Prelude Database.HDBC.Sqlite3> conn <- connectSqlite3 "weight.db"
Prelude Database.HDBC.Sqlite3> import Database.HDBC
Prelude Database.HDBC.Sqlite3 Database.HDBC> st <- prepare conn "select count(*) from user"
Prelude Database.HDBC.Sqlite3 Database.HDBC> _ <- execute st []
Prelude Database.HDBC.Sqlite3 Database.HDBC> fetchRow st
Just [SqlInt64 0]
Prelude Database.HDBC.Sqlite3 Database.HDBC> fetchRow st
Nothing
Prelude Database.HDBC.Sqlite3 Database.HDBC> disconnect conn

haskell-yesod-weight-record-app's People

Contributors

makoto-developer avatar

Watchers

 avatar

haskell-yesod-weight-record-app's Issues

stack buildできない

環境

MacOS
image

ghc version

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.7

stack version

stack --version
Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4

ログ

~~~~~~~~~~~~~~~~~~
途中省略
~~~~~~~~~~~~~~~~~~


unix-time                   > checking for memory.h... yes
unix-time                   > checking for strings.h... yes
unix-time                   > checking for inttypes.h... yes
unix-time                   > checking for stdint.h... yes
unix-time                   > checking for unistd.h... yes
unix-time                   > checking xlocale.h usability... yes
unix-time                   > checking xlocale.h presence... yes
unix-time                   > checking for xlocale.h... yes
unix-time                   > checking for strptime_l... yes
unix-time                   > checking for timegm... yes
unix-time                   > configure: creating ./config.status
unix-time                   > config.status: creating cbits/config.h
unix-time                   > build
zlib                        > configure
unix-time                   > Preprocessing library for unix-time-0.3.7..
zlib                        > Configuring zlib-0.6.1.2...
unix-time                   > Building library for unix-time-0.3.7..
unix-time                   > [1 of 5] Compiling Data.UnixTime.Types
unix-time                   >  
unix-time                   > /private/var/folders/nk/y8y8_lqd78xb3v36wkb3zzbm0000gn/T/stack-270fa405daabf780/unix-time-0.3.7/Data/UnixTime/Types.hsc:3:1: warning: [-Wunused-imports]
unix-time                   >     The import of ‘Control.Applicative’ is redundant
unix-time                   >       except perhaps to import instances from ‘Control.Applicative’
unix-time                   >     To import instances alone, use: import Control.Applicative()
unix-time                   >   |
unix-time                   > 3 | import Control.Applicative ((<$>), (<*>))
unix-time                   >   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zlib                        > build
zlib                        > Preprocessing library for zlib-0.6.1.2..
unix-time                   > [2 of 5] Compiling Data.UnixTime.Sys
zlib                        > Building library for zlib-0.6.1.2..
zlib                        > [1 of 5] Compiling Codec.Compression.Zlib.Stream
zlib                        >  
zlib                        > /private/var/folders/nk/y8y8_lqd78xb3v36wkb3zzbm0000gn/T/stack-270fa405daabf780/zlib-0.6.1.2/Codec/Compression/Zlib/Stream.hsc:374:3: error:
zlib                        >     ‘fail’ is not a (visible) method of class ‘Monad’
zlib                        >     |
zlib                        > 374 |   fail   = (finalise >>) . failZ
zlib                        >     |   ^^^^
zlib                        >  
unix-time                   > [3 of 5] Compiling Data.UnixTime.Diff
unix-time                   > [4 of 5] Compiling Data.UnixTime.Conv
unix-time                   > 
unix-time                   > /private/var/folders/nk/y8y8_lqd78xb3v36wkb3zzbm0000gn/T/stack-270fa405daabf780/unix-time-0.3.7/Data/UnixTime/Conv.hs:11:1: warning: [-Wunused-imports]
unix-time                   >     The import of ‘Control.Applicative’ is redundant
unix-time                   >       except perhaps to import instances from ‘Control.Applicative’
unix-time                   >     To import instances alone, use: import Control.Applicative()
unix-time                   >    |
unix-time                   > 11 | import Control.Applicative
unix-time                   >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^
unix-time                   > [5 of 5] Compiling Data.UnixTime
unix-time                   > 
unix-time                   > /private/var/folders/nk/y8y8_lqd78xb3v36wkb3zzbm0000gn/T/stack-270fa405daabf780/unix-time-0.3.7/cbits/conv.c:1:10: error:  fatal error: 'config.h' file not found
unix-time                   >   |
unix-time                   > 1 | #include "config.h"
unix-time                   >   |          ^
unix-time                   > #include "config.h"
unix-time                   >          ^~~~~~~~~~
unix-time                   > 1 error generated.
unix-time                   > `gcc' failed in phase `C Compiler'. (Exit code: 1)
Progress 13/81           

--  While building package unix-time-0.3.7 (scroll up to its section to see the error) using:
      /private/var/folders/nk/y8y8_lqd78xb3v36wkb3zzbm0000gn/T/stack-270fa405daabf780/unix-time-0.3.7/.stack-work/dist/x86_64-osx/Cabal-3.2.1.0/setup/setup --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package zlib-0.6.1.2 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package text-1.2.2.1 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package th-data-compat-0.0.2.4 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package stm-2.4.4.1 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package foundation-0.0.13 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package primitive-0.6.1.0 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package sql-words-0.1.5.1 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package mmorph-1.0.9 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package cmdargs-0.10.17 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package dlist-0.8.0.2 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package Cabal-1.24.2.0 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1


--  While building package appar-0.1.4 (scroll up to its section to see the error) using:
      /Users/makoto/.asdf/installs/haskell/8.10.7/stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7 --builddir=.stack-work/dist/x86_64-osx/Cabal-3.2.1.0 build --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1

エラーメッセージ

`gcc' failed in phase `C Compiler'. (Exit code: 1)

生成したUser Entityの疎通ができない

User Entityを作成したがロードするとエラーになる

$ stack ghci --no-load               
weight-recorder> initial-build-steps (exe)
Configuring GHCi with the following packages: weight-recorder
GHCi, version 8.10.7: https://www.haskell.org/ghc/  :? for help
Prelude> :l src/Entity/User.hs 
[1 of 1] Compiling Entity.User      ( src/Entity/User.hs, interpreted )

src/Entity/User.hs:12:1: error:
    Illegal type: ‘"primary"’ Perhaps you intended to use DataKinds
   |
12 | defineTableFromDB (connectSqlite3 "weight.db")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Entity/User.hs:12:1: error:
    Illegal type: ‘"password"’ Perhaps you intended to use DataKinds
   |
12 | defineTableFromDB (connectSqlite3 "weight.db")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Entity/User.hs:12:1: error:
    Illegal type: ‘"name"’ Perhaps you intended to use DataKinds
   |
12 | defineTableFromDB (connectSqlite3 "weight.db")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...

src/Entity/User.hs:12:1: error:
    Illegal type: ‘"id"’ Perhaps you intended to use DataKinds
   |
12 | defineTableFromDB (connectSqlite3 "weight.db")
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^...
Failed, no modules loaded.

Entity
https://github.com/makoto-engineer/haskell-yesod-weight-record-app/blob/796c1b398e519957d575f4a43d88fc879742d969/src/Entity/User.hs#L1

コミット
796c1b3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.