-
Notifications
You must be signed in to change notification settings - Fork 141
Add Idris #711
Comments
Is it possible to enforce users to |
We might be able to add test support by forking specdris and changing the output. @ice1000 Can you explain what that is and what's needed to accomplish that? |
@kazk To ensure users don't write unsafe code (like panic in unreachable cases) and infinite-loop code. Idris has the ability to use the type system to eliminate all impossible cases and people are supposed to make use of this mechanic. IDK if it's easy to accomplish since I'm rarely Idrising. I was basically throwing some ideas so people can discuss. |
I guess we can put |
- Remove coloring - Output passed tests - Output in Codewars format - Request: codewars/codewars-runner-cli#711
- Remove coloring - Remove indents - Output passed tests - Output in Codewars format - Request: codewars/codewars-runner-cli#711
The code runner part of Idris support is almost ready. I've got the test support with specdris by forking and changing the output. The code was easy to follow even it was my first time reading Idris. The example from their repo works. Minimum example: module Solution
%access export
%default total
add : Nat -> Nat -> Nat
add a b = a + b module SolutionSpec
import Specdris.Spec
import Solution
%access export
%default total
specSuite : IO ()
specSuite = spec $ do
describe "add" $ do
it "adds two natural numbers" $ do
(1 `add` 1) `shouldBe` 2 The test needs to export |
Just added a thumbs up. I got disappointed at Haskell once when I saw a pile of type system hacking for a seemingly simple task - modular arithmetic; I still have no idea how it works. Idris looks promising in this particular aspect to me. |
Idris is now available on Codewars. |
Great, we finally have a language dedicated to theorem proving on CW! 🎉 One thing though - random tests currently appear to be infeasible in Idris, at least when using specdris. While I doubt random tests will find their use in theorem-proving Kata where totality is enforced (which should make it pretty difficult to get hardcoded "proof"s to type-check), a lot of generic Haskell/PureScript kata on topics other than theorem proving should also be suitable for translation into Idris. In those cases, being able to write random tests could be helpful. Incidentally, pheymann/specdris#1 mentions a QuickCheck implementation in Idris which has not been integrated into specdris as of 06/03/2019. Would such an integration be possible? |
I'd recommend working with specdris authors and make something that can be used by the Idris community and not just on Codewars. We're using specdris with minimal change so we should be able to use it too. I'd start by asking them for their plans and what can be helped. It has "help wanted" label so I'm sure they're looking for some help :) I have no experience with Idris so I can't help with this. Maybe some of our users can, but I think the discussion should happen on pheymann/specdris#1. |
I've did the first non-multiply Kata translation: https://www.codewars.com/kumite/5c7fbeaf9775762c55934656?sel=5c7fbeaf9775762c55934656 |
@kazk There's a critical issue in regards to type holes:
In fact even this works, it's completely absurd: module Absurd
%access export
%default total
wtf : 2 + 2 = 5
wtf = ?oh_my_god_how_do_I_prove_this |
/cc #717 |
There's another issue(?): Every data type and type level function must be I think at least this should be documented somewhere? |
Doilecument |
Please complete the following information about the language:
The following are optional, but will help us add the language:
idris solution.idr -o solution && ./solution
(wheresolution.idr
is the Idris program to be compiled)👍 reaction might help. Special mentions: @ice1000 , @MarisaKirisame 😉
The text was updated successfully, but these errors were encountered: