Hi! I'm having a lot of fun learning with this pos...
# arrow
m
Hi! I'm having a lot of fun learning with this post: https://www.47deg.com/blog/conway-swift/ Many thanks to @tomasruizlopez for that! πŸŽ‰ As a result of my learning, I carried the code from bow to arrow. Here is the repository https://github.com/matiaslev/ArrowLifeGameComonads. PS: If I do an Android project, I don't see the code generated for the type classes. If someone can help me it would be great. I hope it is useful for another person. Thanks!
🏹 5
πŸ‘ 4
🍎 3
arrow 5
p
Have you done the additional setup step? xhttps://github.com/arrow-kt/arrow#additional-setup
specifically the
generated-kotlin-sources
step
m
Hi @pakoito! πŸ™‚ yes, but the generated code goes to a build/tmp folder that is not on the list. If I add the folder to the list, doesn't works also.
p
...that's weird
how are you triggering the build?
./gradlew clean assemble
?
TODO() // Not Needed, use the implementation inside Functor
this will except, the implementation is easy
flatMap { just(f(it)) }
j
just inherit
Functor
:
FocusedGridComonad: Comonad<ForFocusedGrid>, FocusedGridFunctor
unless there are multiple defaults in the hierarchy kotlin won't complain ^^ Thats how most of the typeclasses are defined in arrow to avoid redundant overrides
m
thanks! I will see these improvements. yes, after clean assemble I am in the same situation πŸ€”
p
does the compiler give you any errors?
m
assemble works from the IDE... but give me this error if I run it from the console πŸ€”
Copy code
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Lint infrastructure error
  Caused by: java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at com.android.tools.lint.gradle.api.ReflectiveLintRunner.runLint(ReflectiveLintRunner.kt:38)
        at com.android.build.gradle.tasks.LintBaseTask.runLint(LintBaseTask.java:114)
        at com.android.build.gradle.tasks.LintPerVariantTask.lint(LintPerVariantTask.java:64)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
m
Hi @matiaslev - @Jorge Castillo also did an Arrow version you can check out here: https://www.47deg.com/blog/conway-kotlin/
m
yes πŸ™‚ thanks!
I translated the other one as it's a different approach and as a learning exercise. I will go over the SwiftUi - Compose translation too when I figure out the problem I am experiencing with android.
πŸ‘ 1
m
Cool, if you finish it would be a great thing to add to our new media section πŸ˜‰
m
wow thanks! I will let you know when it's ready. this will be an excellent motivation πŸ™‚
πŸ”₯ 2
@pakoito works for the stable android studio version but not for the preview. The real problem is the gradle version πŸ€”.
Copy code
//    buildFeatures {
//        compose true
//    }
a
@matiaslev I've checked the code and looks good overall. If you have a branch for Android specifically where that problem can be seen let me know so I can take a look and maybe help you
m
thanks @aballano! The bug I found is about using compose with kapt. It's a knwon issue documented here https://youtrack.jetbrains.com/issue/KT-34583. I created different modules, in one the UI with compose, and in the other one arrow with meta. I will share the android project soon πŸŽ‰
πŸ‘Œ 1
πŸ‘ 1
@Maureen the Arrow + Compose implementation for the Comonad approach is done πŸŽ‰ https://github.com/matiaslev/ArrowComposeLifeGame/tree/master
m
Awesome, thanks! You can either submit a PR here: https://github.com/arrow-kt/arrow-media or I can do it next week when I’m back from vacation.
m
do you have a handle I can refer to?
I would add that video to the Readme, it looks brilliant! You just need to drag & drop it when editing it from the website.
m
thanks @pakoito! this community is amazing, I am pretty gratefull arrow
what do you mean by a handle? haha sorry, I didn't get it
I don't use social media really if it's what you mean. But I feel really happy to see people from which I learn sharing my work. a lot of thanks for this!