Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added make rule for omitting code generation #496

Merged
merged 1 commit into from
Jun 16, 2016
Merged

Added make rule for omitting code generation #496

merged 1 commit into from
Jun 16, 2016

Conversation

EliasC
Copy link
Contributor

@EliasC EliasC commented Jun 16, 2016

It turns out that the most expensive part of building encorec is the
code generation phases. The GHC option -fno-code stops after
typechecking, and on my machine the difference in runtime is 5 seconds
vs. ~1.45 minutes. This commit adds the rule typecheck to the root
makefile, which meant to be used when no executable needs to be
generated (i.e. for only checking code that you wrote).

Emacs users using haskell-mode might be interested in the following hack
to make the compilation command default to only typechecking, and also
try to start a new haskell session if no one is present:

(defun ec/haskell-typecheck ()
  (interactive)
  (progn
    (cond ((null haskell-session) (haskell-session-change)))
    (haskell-process-do-cabal "build --ghc-options=-fno-code")))

(add-hook 'haskell-mode-hook
   (function
    (lambda ()
      (local-set-key (kbd "C-c C-c") 'ec/haskell-typecheck))))

It turns out that the most expensive part of building encorec is the
code generation phases. The GHC option `-fno-code` stops after
typechecking, and on my machine the difference in runtime is 5 seconds
vs. ~1.45 minutes. This commit adds the rule `typecheck` to the root
makefile, which meant to be used when no executable needs to be
generated (i.e. for only checking code that you wrote).

Emacs users using haskell-mode might be interested in the following hack
to make the compilation command default to only typechecking, and also
try to start a new haskell session if no one is present:

```
(defun ec/haskell-typecheck ()
  (interactive)
  (progn
    (cond ((null haskell-session) (haskell-session-change)))
    (haskell-process-do-cabal "build --ghc-options=-fno-code")))

(add-hook 'haskell-mode-hook
   (function
    (lambda ()
      (local-set-key (kbd "C-c C-c") 'ec/haskell-typecheck))))
```
@EliasC
Copy link
Contributor Author

EliasC commented Jun 16, 2016

No idea why CI fails, it builds fine on my machine.

@kikofernandez
Copy link
Contributor

it is an old error, if you re-push it should be fine

@albertnetymk
Copy link
Contributor

Looks all right. Merging if no objections.

@albertnetymk albertnetymk merged commit 6a91938 into parapluu:development Jun 16, 2016
@EliasC EliasC deleted the features/typecheck-only branch June 17, 2016 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants